Dortmund's surprise first loss of the season at Fortuna Dusseldorf on Tuesday opened the door for the champions to reignite their title hopes and they did just that late in a largely frustrating fixture.
Peter Gulacsi brilliantly denied both Robert Lewandowski and Joshua Kimmich either side of half-time but the visitors' resistance came to an end when substitute Ribery hit home amid a penalty box scramble.
Both sides were reduced to 10 men in stoppage time - Renato Sanches receiving a second yellow for reacting to a rash challenge on Thiago Alcantara that earned Stefan Ilsanker a straight red - but Niko Kovac will care little after securing a valuable fourth successive Bundesliga victory.
For Devices running OS 6+