In a game that was a must win for both teams, Bayern Munich emerged victorious thanks to a second-half winner from Mats Hummels, after Thiago had given them the lead on the half-hour mark.
The away side hit back immediately after the midfield's opener in delightful fashion as Hakan Calhanoglu equalised just five minutes later to tie the game.
In a game that showed just how desperate both Bayern and their opponents, Bayer Leverkusen, were to get the three points, the home side scraped through and weren't entirely dominant as Leverkusen gave it their all and made it a tough game for Carlo Ancelotti and his players.
This victory sees Bayern still three points behind surprise leaders RB Leipzig and Leverkusen still sit on 9th in the Bundesliga standings.
Ancelotti made a lot of changes to his team following a disappointing Champions League loss to FC Rostov.Hummels was a notable inclusion, Joshua Kimmich drafted in at right-back in place of Rafinha, Manuel Neuer returned to action following a calf injury. David Alaba took his place at left-back once again.
Xabi Alonso returned to the starting XI as Renato Sanches dropped to the bench.Up front, Robert Lewandowski kept his place and Thomas Muller started alongside Douglas Costa,while Franck Ribery had to settle for a place on the bench. The returning Arjen Robben could only make the bench for this one.
For Leverkusen, there were four changes from their 1-1 draw with CSKA Moscow in the Champions league. Javier Hernandez and Kevin Volland dropped to the bench along with Tin Jedvaj, with Benjamin Henrichs returning to the team with young Kai Havertz starting only his second game this season on the flanks for the away side, while Omer Toprak made way for the Austrian Aleksandar Dragovic.
First half produced a frantic 45 minutes
The first half saw both teams start aggresively and produced a numerous early chances to take the lead for both the teams. Roger Schmidt's Leverkusen were the first to get a shot away just after two minutes, when Ademir Mehmedi shot just wide with a low-drive against Manuel Neuer who didn't look his usual commanding self in the game.
After a few exchanges in the middle of the park, Bayern got the upper hand and had a chance to take the lead themselves, but David Alaba couldn't convert with his opportunity.
After a flurry of chances, the home side finally took the lead, Alaba crossed it in, Joshua Kimmich received, squared it to his captain Phillip Lahm who fizzed a powerful effort at Bernd Leno, the young German could only parry the shot and Thiago was on hand to tap in a header to make the score 1-0.
Leverkusen didn't back down and kept going at it and got their just rewards just five minutes after the opener. It was a great counter attack involving Julian Brandt and Hakan Calhanoglu, the two midfielders playing a great one-two before the Leverkusen no.10 shot into the roof of Manuel Neuer's goal to tie the scoreline.
Leverkusen would have been the happier of the teams going into half-time, Schmidt's men responded well to falling behind and left Bayern's defence questioning themselves once again. Judging by the first half, it wasn't a question of creating chances, but rather taking them was the problem for Ancelotti's men.
Hummels scores first goal for Bayern and seals the win
The second half saw Bayern get off to the better start with more of an impetus in their style of play. Costa was the first one to challenge Leno, a wonderful run into the box and another low-drive towards goal which the Leverkusen shot-stopper kept out, before Wendell cleared Costa's rebound effort.
Just moments later, the home side didn't have to wait long for a goal when Kimmich's perfect delivery from the corner found the head of Mats Hummels, the German international headed the ball into the back of the net expertly to get off the mark for Bayern with his first goal.
Leverkusen kept at it during the whole game and did not lose heart, Schmidt brought on Javier Hernandez and Kevin Volland in an attempt to attack Bayern and cause them more problems. While they managed to worry the home side's defence on more than one occasion, the away side still lacked that final ball and the clinicalness required to finish off chances and therefore lost the match, but Schmidt can be proud of the performance his boys put in, it was not an easy ride for Ancelotti's team by any measure.