Both sides finished with 10 players in a game where Norway striker Mohammed Abdellaoue and Germany defender Christian Pander scored the Hanover goals which inflicted only the second defeat of the season on Bayern.
After Abdellaoue converted a 23rd-minute penalty for Hanover, the game boiled over when Bayern defender Rafinha fouled Hannover’s Sergio Pinto and players from both teams piled into a melee three minutes later.
After referee Manuel Gräfe restored order he sent off Bayern’s Germany defender Jerome Boateng for a heavy shove on Hanover defender Christian Schulz, who was shown a yellow card.
Pander then rifled in a shot on 50 minutes, but Hanover were also reduced to 10 men when captain and US defender Steven Cherundolo was sent off for a foul on Franck Ribery after 63 minutes.
Austria star David Alaba pulled a goal back for Bayern with seven minutes left to play and Germany midfielder Bastian Schweinsteiger hit the post two minutes before the final whistle.
“My team lost today, but I liked what I saw from them more than from some of the heavy wins we have had this season,” said Bayern coach Jupp Heynckes.
“That was an intensive game with lots of feeling from both teams. I must say a lot of things went against us. We conceded a penalty and had a player sent off.
“Boateng was pushed just as much as Schulz, both players should have been shown a yellow card, but the referee was influenced by the fourth official.
“I think if we could have got to 1-1 just after the break, we could have gone onto win the game.”
Hannover’s win leaves them fourth in the table.
“I had told the referee he should let the game carry on and not continue showing cards,” said Hanover coach Mirko Slomka, who had tried to stop the referee sending Boateng off.
“We defended well over the 90 minutes after they threw everything they had at us. It was important to attack them and not let Bayern play their usual game.”
Bayern goalkeeper Manuel Neuer had his run of clean-sheets in the Bundesliga ended by Abdellaoue’s converted penalty to leave him with 771 minutes in play without conceding a goal – short of the record of 884 minutes.
After defending champions Borussia Dortmund hammered Cologne 5-0 on Saturday to move up to second place in the league, the defeat leaves Bayern only three points clear.
Jürgen Klopp’s Dortmund dismantled Cologne with Poland striker Robert Lewandowski scoring twice in the rout.
Peru striker Jefferson Farfan hit a late winner to give Schalke 04 a 1-0 win over Bayer Leverkusen on Sunday to lift the Royal Blues up to third.
With Borussia Mönchengladbach dropping to seventh from second in the table after their 1-0 defeat at Hoffenheim, Stuttgart were up to fifth following a 2-2 draw at Nuremberg.
An 84th-minute header from Mexico defender Francisco Rodriguez gave Stuttgart the equaliser that secured their point.
Werder Bremen are sixth after they drew 1-1 with Augsburg on Friday.
Freiburg replaced Hamburg at the foot of the table after going down 1-0 at Kaiserslautern.
Having been appointed Hamburg coach on Monday, ex-Bayern player Thorsten Fink got off to a good start with a 1-1 draw at home to 2009 champions Wolfsburg.
The former FC Basel manager still has his work cut out, with his new team having won just two of their 10 league games this season, collecting eight points on the way.