Bayern, who were made to work against a daring team, benefitted from results elsewhere, such as Leipzig's defeat.
Leipzig were surprised at home to Schalke 04, who went up 1-0 through Salif Sané's header from a corner. They doubled their lead in the 43rd minute through a Harit penalty.
The Leipzig manager, Julian Nagelsmann, rotated his side and made 5 changes in the starting XI, which could have made them lose fluidity in their play.
Emile Forsberg pulled one back in the 84th minute, which was too late, with a shot from outside the box that was helped by an Alexander Nubel error.
Borussia Monchengladbach won 3-0 away to Hoffenheim and Bayer Leverkusen won by the same margin away to Augsburg, whereas Mainz lost 1-0 at home to Wolfsburg.