Sean Mitchell, 46, inflicted four stab wounds on Stephen Dagg, 53, when he attacked him from behind at the St Mary's Vaults pub in Stamford, Lincolnshire.
Lincoln Crown Court heard there was a history of hostility between the men.
Mitchell, who was a publican at the nearby Melbourn pub, had previously banned Mr Dagg from his premises.
More on this and other local stories from across Lincolnshire
The court heard Mr Dagg was drinking in the St Mary's Vaults pub on 12 June when Mitchell burst in to the pub and was heard to say: "Where's that queer."
Witnesses then described Mitchell, a father-of-three, attacking Mr Dagg from behind and inflicting four "karate chop" type blows to his neck and shoulder area.
The publican of St Mary's Vaults confirmed all of her knives were accounted for which meant Mitchell must have brought his steak knife with him.
Mr Dagg was then chased three or four times around the pub and hid behind the bar before he managed to escape outside.
He was later admitted to hospital in Peterborough where was he treated for four stab wounds.
Mitchell, who also had a supervisory role at the St Mary's Vaults pub, later said he had no memory of the attack and simply did not know why it had happened.
Mark Watson, mitigating, admitted Mitchell had brought the weapon with him, but had no recollection of what happened.
He added: "He had and has no idea about the complainant's sexuality. It was simply generic abuse."
Mitchell, of All Saints Street, Stamford, admitted a charge of wounding Mr Dagg with intent to cause him grievous bodily harm and having an offensive weapon.

Media playback is not supported on this device
Caley Thistle lie five points adrift at the bottom of the Premiership with just five games of the season remaining.
"It's massive," Foran told BBC Scotland. "Biggest game of my career, biggest game of the players' careers.
"Ross County [are] probably out of the relegation battle but we can drag them back into it."
The recruitment of former assistant manager Maurice Malpas last week was designed to address defensive problems.
Foran concedes that it was the club's directors who proposed the idea of adding more experience to the coaching team, but insists that he identified Malpas as the man to appoint.
"The board thought it would help by bringing someone else in," Foran said. "An older, more experienced person.
"We're all trying to fix the problem. I had a think who was out there, who I could trust, who had the game knowledge and Scottish Premiership knowledge, so I picked Maurice.
"The board recommended I bring someone in. There was no problem with that."
With just four wins from 33 league fixtures, retaining their top-flight status seems an uphill task for Inverness, particularly given their record of conceding more goals than any side in the Premiership.
"Defensively as a team, it hasn't been good enough," Foran said.
"[We've] probably been too open at times attacking, so we've worked on that. There's obviously been a problem; we've conceded too many goals.
"Maurice has over 50 caps. He's managed, he's been assistant manager. But the main thing for me, you can always trust Maurice.
"He's old school and is never going to stab you in the back. He'll always say it straight to your face and he's good to have around the place."
A publican who repeatedly stabbed a man with a steak knife has been jailed for four years.
[NEXT_CONCEPT]
Inverness Caledonian Thistle manager Richie Foran insists Friday's Highland derby against Ross County is the most important match of his career.