Brady erased a 27-24 deficit with 7:14 remaining in the game, finding Hernandez on the left flat for a touchdown after marching the Patriots down the field on a six-play, 67-yard drive.
New England (12-2) then stopped two Packers drives directed by quarterback Matt Flynn, who was making his first NFL start, and emerged with its sixth straight win, which clinched the AFC East title and a first-round bye for the Patriots.
Brady went 15-of-24 for 163 yards, with no interceptions and two TDs for the Pats, who picked up their 16th straight regular season home win.
Flynn completed 24-of-37 pass attempts for 251 yards while subbing for the injured Aaron Rodgers, hurling three touchdown passes.
James Jones made five grabs for 95 yards and a score and Brandon Jackson racked up 99 yards on 22 carries for the Packers (8-6), who fell a half-game behind Chicago in the NFC North.