Lukasz Piszczek gave Dortmund the lead in the 29th minute, but Alexandru Maxim's first Bundesliga goal brought the Swabians level before a red card to Georg Niedermeier tipped the scales back in Dortmund's favour.
Just over 10 minutes after being given a one-man advantage, Robert Lewandowski struck to earn Dortmund all three points and keep the title race alive, at least for a further seven days.
Dortmund knew that only a win would deny Bayern the chance of clinching the title with victory over Hamburg on Saturday evening, and they looked hungry for it.
So too did Stuttgart, who are still not safe near the bottom of the table, and this ensured a dramatic game similar to the one which ended 4-4 between the two sides a year ago to the day.
Sven Ulreich denied Marco Reus in a one-on-one situation in the 11th minute before Marcel Schmelzer had to leave the field with a suspected broken nose after being caught in the face by the foot of Martin Harnik.
Piszczek came on for the Germany international, and he had been on the field just five minutes when he headed Dortmund in front from Reus' cross.
Stuttgart levelled in the 63rd minute with Maxim getting his name on the scoresheet for the first time in the Bundesliga, showing a composed finish when the ball fell to him somewhat fortunately.
The chances of Stuttgart mounting a challenge for all three points were reduced in the 70th minute when Niedermeier picked up his second yellow card of the game to head for an early bath.
With an extra man, Dortmund regained control of the game and Lewandowski ensured he scored for the ninth game in a row in the 82nd minute to seal the points for Jurgen Klopp's men.
Compatriot Piszczek was the provider with a low cross which invited the Poland international to continue his excellent goalscoring form and keep him at the top of the Bundesliga scoring charts with 20 goals for the season, and keep Dortmund, theoretically at least, still in the hunt for the title.