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.
Borussia Dortmund Player Ratings
Marwin Hitz - 6/10
Conceded four goals but still made five saves on the evening. He did well to ensure his side did not lose by more.
Thomas Meunier - 5/10
He was an attacking outlet for the first half, with his side constantly switching play to his wing. However, he fizzled out as the game progressed and was defensively susceptible.
Emre Can - 5.5/10
A calm performance in defense from the German. While he seemed the most assured of Dortmund's back three, he was bullied off the ball far too easily during the build-up to Bayern's third goal.
Mats Hummels - 5/10
The former Bayern Munich defender had an evening to forget as he constantly lost track of Robert Lewandowski and failed to close him down on a number of occasions.
Dan-Axel Zagadou - 5/10
The Frenchman put in a decent shift in just his third start for the Black and Yellows this league campaign.
Nico Schulz - 4.5/10
The full-back returned to the starting XI for the injured Raphael Guerreiro. Schulz had a tough time on his second league start this campaign as he was run ragged by Sane for most of the game and his lack of match sharpness was obvious.
Thomas Delaney - 5.5/10
The veteran midfielder provided the assist for the opening goal of the game with a simple pass to Haaland, who finished with great aplomb.
Mahmoud Dahoud - 4/10
Dahoud failed to impress in his fifth straight start for the visitors. He was sent off in his last game for Dortmund in their DFB Pokal tie and was once again calamitous as he gave away a penalty very cheaply in the first half.
Marco Reus - 5/10
The captain showed glimpses of his quality on the ball with technical skills and deft touches. However, he was guilty of sloppiness in passing as he completed a game low 52% of his passes.
Thorgan Hazard - 5.5/10
Hazard made his first league start since October last year and got an assist for his side's second goal with a well-timed square ball for Haaland to tap in.
Erling Braut Haaland - 7/10
The best player for the visitors by a mile. The 20-year-old took his league tally up to 19 goals for the campaign with two goals in the opening nine minutes of the game. He was removed for precautionary reasons early in the second half.
Player ratings for Borussia Dortmund substitutes
Julian Brandt - 5/10
The German came on for the final 30 minutes, but struggled to impact the game.
Steffen Tigges - 5/10
Tigges came on for Haaland after the latter took a knock. While he was agile and active on the pitch, he couldn't provide the goal needed for his team.
Mateu Morey - 5/10
Came on for the final 20 minutes and completed just one pass.
Jude Bellingham - 5/10
The Englishman came on late and could only keep possession for his team.
Reiner - 5/10
Came on late and failed to impact the game.