Hansi Flick's men, therefore, needed a win against their archrivals to return to the top of the Bundesliga and continue their title defense.
The visitors, Borussia Dortmund, have had some shaky periods in the league this campaign but were enjoying a good run of form, winning four straight games in all competitions.
The Black and Yellows came into the game off the back of a 1-0 victory over Borussia Monchengladbach in the DFB Pokal, a win that saw them advance to the semifinal of the cup.
Der Klassiker began in its usual high octane fashion with both sides bursting out of the blocks. Dortmund, however, looked the sharper of the two sides and quickly went two goals up in the opening nine minutes of the game with both goals coming from Erling Haaland.
The first goal, which came 74 seconds into the game, was a 25-yard strike from the Norwegian striker which took a deflection off Boateng before going in.
Dortmund kept their relentlessness up and were rewarded seven minutes later with a brilliantly worked team goal which led to a simple tap-in for Haaland for his second of the evening.
Bayern Munich immediately turned up the heat and kept their opponents camped in their defensive third with wave after wave of attacks.
Bayern Munich’s probing finally paid off when Robert Lewandowski found the target just before the half-hour mark, helping the Bavarians half the deficit.
The home side kept possession high up opposition territory and a low-drilled cross from Sane from the left wing found Lewandowski in the box for an easy tap-in.
The Bayern Munich forward soon got a first-half brace of his own when he converted a penalty shortly before the break to level the scores.
A foul from Dahoud on Coman saw the referee award a penalty to the home team after a quick VAR review and the Polish striker did well to slot home from 12-yards.
The early stages of the second half saw a significant drop in tempo and urgency from the two sides as fatigue and a lack of invention set in.
Bayern Munich, however, regained their hunger and desire in the final 20 minutes of the game and looked the surer side to score.
The persistent pressure from the hosts did not go in vain as they sealed the win with quick goals from Leon Goretzka and Lewandowski, respectively, to record a 4-2 comeback win over Dortmund.
The result sees Bayern Munich return to the top of the Bundesliga, two points ahead of RB Leipzig in second place.
Borussia Dortmund, however, remain sixth in the league, four points off the Champions League spots.
Bayern Munich Player Ratings
Manuel Neuer - 6/10
A bang-bang opening 10 minutes saw the Bayern Munich shot-stopper concede from the two shots taken by the visitors in the first half. He managed to save the only other one he faced in the second half.
Niklas Sule - 6.5/10
Sule's development as a makeshift left-back continued on the evening as the German displayed impressive technical quality for a man of his size. He was as influential in Bayern Munich’s defense as he was in attack.
Jerome Boateng - 6/10
The German was unlucky to have had the opening goal of the game deflected off him. He also failed to track Haaland's run en route to the second goal. However, he got far better as the game wore on. Unfortunately, got injured in an act of resolute defending.
David Alaba - 6.5/10
The more mobile of Bayern Munich's central defenders, Alaba did well to keep possession and constantly played long balls forward to speed up play.
Alphonso Davies - 6.5/10
The Bayern Munich youngster was credited with an assist for the final goal of the game with a simple infield pass to Lewandowski.
Joshua Kimmich - 6.5/10
Another utterly dominant performance from the midfielder. Kimmich was once again the engine in the Bayern Munich team, constantly driving his side forward with incisive line-breaking passes. He had the most touches on the pitch.
Leon Goretzka - 7/10
Goretzka got the goal which completed the comeback late in the game with a brilliantly timed volley into the bottom corner.
Thomas Muller - 6.5/10
Muller had a quiet evening by his own standards but was useful, nonetheless. He did his job diligently before being replaced by Choupo-Moting in the dying minutes of the game.
Leroy Sane - 6.5/10
Sane's rise in form continued on his sixth straight start for the Bavarians. The winger provided the assist for Bayern Munich’s first goal of the game with a low-drilled cross into the box.
Kingsley Coman - 6.5/10
The Frenchman won the equalizing penalty for Bayern with some nifty footwork in the box. He completed a joint-team-high three take-ons in the game.
Robert Lewandowski - 8/10
A man-of-the-match performance from the Polish striker who scored a hat-trick on the evening. Lewandowski, who has made a habit of finding the net against his former side, did not have his best game but bagged three goals, which speaks volumes of the quality he possesses.
Player ratings for Bayern Munich substitutes
Serge Gnabry - 6.5/10
The first substitute for the home side. Gnabry replaced Coman in the 66th minute and was lively in his time on the pitch.
Javi Martinez - 6.5/10
The Spaniard came on for the injured Jerome Boateng in the 70th minute. He did his bit defensively to ensure his side shipped no further goals.
Eric Maxim Choupo-Moting - 6/10
The Bayern Munich forward came on late and made no telling contribution.
Lucas Hernandez - 6/10
He came on late and did nothing.