Brisbane took the field wearing special commemorative jumpers with "Lockyer 350" embroidered on their chests.
The jumpers were presented to the players on Thursday night after they watched a special video message wishing their skipper good luck from the club's inaugural captain Wally Lewis.
Brisbane led 18-10 at halftime after Hoffman's fifth and 25th minute tries which were split by rookie Jack Reed's four pointer, his 10th of the season, in the 12th minute.
The Cowboys took almost 20 minutes to get on the scoreboard with winger Faifai Loa doing some excellent work to crash over wide out off a Matt Bowen overhead pass.
Cowboys five-eighth Ray Thompson was denied a try in the 30th minute after video replays show winger Ashley Graham stepped on the touch line before getting his inside pass away with the home side down 18-4.
A few minutes later Johnathan Thurston appealed for a penalty try after Loa who was chasing down his chip kick collided with Brisbane winger Dale Copley.
"Its not a penalty try John, I don't know if he (Loa) would have got there," said referee Gavin Badger.
Hoffman started the the second half the way he finished the first with an 80 metre try after swooping onto a bouncing ball on his own 20 metre line to extend Brisbane's lead to 24-10.
When Brent Tate scored for the Cowboys and Thurston converted to make it 24-16 it was game on again until Copley, a late replacement for winger Jharal Yow Yeh sprinted 75 metres to score Brisbane's fifth try.
It was a great night for Lockyer who after celebrating his first career milestone of 50 games with a win at Dairy Farmers Stadium has not enjoyed much luck at the ground where he suffered a serious knee injury in 2007.
He was presented with the game ball which was placed in a glass case by NRL chief executive David Gallop.
"Tonight we get to celebrate an incredible milestone in our game," Gallop told the crowd.
"Brisbane, Queensland and Australian captain clocks up 350 games, that's an enormous effort."
Lockyer thanked the crowd after the game and said: "I'm going to miss it, I always enjoying playing in front of you."
BRISBANE 34 (J Hoffman 3 D Copley J Reed tries C Parker 7 goals) bt NORTH QUEENSLAND 16 (M Bowen K Fai Fai Loa B Tate tries J Thurston 2 goals) at Dairy Farmers Stadium. Referee: Gavin Badger, Matt Cecchin. Crowd: 26,463.
- AAP