Ribery leaves it late to save Bayern
For long periods on Wednesday, it looked as if Bayern would squander the opportunity given to them by Dortmund's shock defeat by Fortuna Duesseldorf on Tuesday.
Both sides came within inches of taking the lead in the first half. Robert Lewandowski was denied by a fine save from Peter Gulacsi at one end, while Dayot Upamecano thundered a header against the crossbar at the other.
Niklas Suele and Joshua Kimmich both missed chances from close range in the second half. Two red cards for Renato Sanches and Stefan Ilsanker crowned a scrappy game late on, but not before Ribery had finally swept in an 83rd-minute winner to breathe new life into the title race.
Bayern remain in third, but are now five points ahead of fourth-placed Leipzig. Eintracht Frankfurt, meanwhile, remain hot on Leipzig's tail despite being held to a 2-2 draw at local rivals Mainz. Robin Quaison fired Mainz ahead on ten minutes before Luka Jovic pulled Frankfurt level on the half-hour mark.
Quaison restored the lead just five minutes later, turning in a dipping cross from Jean-Paul Boetius. Not to be outdone, Jovic headed in a second equaliser moments before half-time.
Elsewhere, Werder Bremen held Hoffenheim to a 1-1 draw, while a bottom-of-the-table clash between Freiburg and Hanover also ended one goal apiece.
Bremen had several chances early on, including a remarkable miss at point blank range from Yuya Osako. The Japanese came to regret his poor finishing when Leonardo Bittencourt put Hoffenheim ahead at the other end.
The home side, who had been accused of using a drone to spy on Hoffenheim in the build-up to the game, equalised through Theodor Gebre Selassie shortly the break.
Freiburg took the lead with just two minutes played, Luca Waldschmidt converting a penalty after a clear handball from Hanover captain Waldemar Anton. Ten minutes later, Felipe hooked the ball in from a corner to draw Hanover level and lift them off the bottom of the table.