The Germany international duo were on target as the Bundesliga giants edged the Lower Saxons, drawing them to within striking distance of first place
Both sides had their share of chances to take the lead in the opening exchanges, but Bayern showed the extent of their class as Toni Kroos opened the scoring on 36 minutes, and the hosts took their lead into the half-time break.
Substitute Mario Gomez scored a critical second goal midway through the second half, but Didier Ya Konan pulled one back with a quarter hour left, setting up a nail-biter of a finale.
With Bastian Schweinsteiger sidelined through injury and both Gomez and Thomas Muller on the bench, the Bavarians had trouble against a well-coached and fast-attacking Hannover side.
Ivica Olic, who replaced Gomez in attack, was played in on goal early by Kroos, but the Croatian was unable to beat Ron-Robert Zieler in a one-on-one situation. Shortly thereafter, Franck Ribery led the counterattack and set up Arjen Robben, but the Dutchman's first touch let him down and he volleyed over the bar.
Bayern appeared to be headed towards a disappointing result after a glorious sequence on the right saw Robben play Philipp Lahm behind the Hannover defence, but Ribery failed to hit the target from close range following the right-back's low cross.
Hannover gathered some momentum, and were unfortunate not to go ahead after Manuel Neuer's loose touch saw the goalkeeper concede possession to Mame Biram Diouf in front of the net. Desperate defending from the Bavarians' defence, including Neuer, ensured that the visitors could not put a shot towards goal.
Diouf later did well to make space and shoot, but Neuer made a good save. The deadlock was broken in the 36th minute after Ribery made a brilliant turn and run up the left side before flicking to Robben. The Netherlands international back-heeled the ball to Kroos, who chipped over the onrushing Zieler and into the net.
Bayern could have made it 2-0 before the break, but Olic squandered an opportunity again prepared by Kroos, and the hosts had to settle for a one-goal lead at the break.
Chances were few and far between after half-time, but the addition of Mario Gomez for Olic on the hour mark saw Bayern add a new threat in attack. Ribery played a fine pass to the substitute shortly after his introduction, but the striker's shot rebounded off the post and Zieler before being cleared off the line.
Gomez got his goal on 68 minutes, however, as he latched onto Kroos' considered pass, made space from Christian Pander, and tucked his finish inside the far post.
Hannover reacted positively following Bayern's second goal, and pulled one back within six minutes as Diouf nodded a cross towards the substitute Ya Konan, who struck an overhead volley into the net.
Hannover continued to pressure their hosts, and Diouf nodded just over the bar before a near-own goal from Jerome Boateng was tipped around the post by Neuer.
It was not easy, but the hosts did just enough to deny a late equaliser, and held on for three points.
The result sees Bayern trim Dortmund's lead to two points, although BVB will have a chance to extend their advantage once more on Sunday. Hannover, meanwhile, stand in danger of slipping out of seventh place, which holds a Europa League berth, depending on Stuttgart's result.