A first half hat-trick from David Fusitua seemed to give the Warriors an unassailable advantage, despite his side conceding the first try at Mount Smart Stadium.
But the Knights struck back with three quick tries in the second spell turning the Warriors 20-8 half-time lead into a 22-20 defecit.
Hoffman stepped up in the 73rd minute, running onto a short ball and busting over the line when his side needed it most.
Half-back Shaun Johnson told Sky Sport to open the season with a win was "definitely a positive."
"We stuck in, it was a tough match, we won ugly and we're going to have to do that throughout the year."
Lock Simon Mannering (neck) and hooker Isaac Luke (ribs) left the field early with injuries.
Photo: Photosport (Ryan Hoffman looks on as Solomone Kata scores a try).