Thiago Alcantara struck in the dying moments with a match-winning bicycle kick – his first league goal for the club – which gave Bayern the points after Claudio Pizarro had levelled the scores with less than quarter of an hour left on the clock.
The Peruvian striker – now the ripe-old age of 35 – came off the bench to seemingly salvage a point for the German champions, who had been trailing for nearly an hour after Vedad Ibisevic put Stuttgart in the lead on 29 minutes.
Pep Guardiola’s men are now 13 points clear of Bayer Leverkusen and 18 ahead of Borussia Dortmund at the top of the table.
Just as at Borussia-Park on Friday, Bayern were in control from the offset. The possession statistics – as perhaps meaningless are they are – were firmly tipped towards the Bavarians, who had 80% of the ball in the first 20 minutes.
But Stuttgart had more punch. The front trident of Abdellaoue, Timo Werner and Ibisevic posed a rough interrogation of the Bayern back-four’s capabilities whenever they had an opening.
And it was little surprise when the Swabians broke the deadlock after 29 minutes. The bright, lively Werner drilled a shot at goal which trickled through to the Bosnian frontman Ibisevic, who showed composure to tuck the ball beyond Manuel Neuer.
There were few purposeful attempts at goal until the break; just a Thiago Alcantara shot from 30 yards for the visitors, while Stuttgart passed up some good counter-attacks with rather slack decision-making.
Ibisevic came aongisingly close to snatching a second for Stuttgart seconds after the restart with the Bosnian poking the ball wide from seven yards.
In contrast to the first 25 minutes, Bayern were uncomfortable with Stuttgart’s high defensive-block as head-coach Thomas Schneider looked to stop their attacks at source.
After 53 minutes, a superb, sweeping counter-attack from goalkeeper Sven Ulreich right through to Martin Harnik missed only the vital finish it deserved Jerome Boateng cleared desperately off the goal-line.
Four yellow cards in seven minutes summed up the sort of game Stuttgart wanted this to become, yet Guardiola wasted no time to make changes with Pizarro and Mario Mandzukic entering the fray.
Toni Kroos's departure early on – and his subsequent tantrum – will only fuel speculation about his future in Munich.
But Guardiola’s re-shaping of the attack with Goetze and Meuller flanking a two-prolonged strike-force of Pizarro and Mandzukic almost counter-acted Stuttgart’s high-pressing.
With 20 minutes to go, Pizarro worked a delicious one-two with former Barcelona man Thiago who strolled into the penalty box, but was denied a goal by a long-leg of Ulreich.
When Mueller and Goetze both failed to convert amidst a chaotic scramble inside the six-yard box, it seemed just a matter of time before Bayern equalised.
And, on 75 minutes, the scores were levelled with substitute Pizarro nodding in a free-kick from Thiago’s inswinging delivery.
As much as Stuttgart looked to be running out of steam, the match was still played at a thrilling end-to-end nature with the sides both opting for direct 4-4-2 formations.
Having been on the ropes for most of the game, Bayern could thank Dante for a last-ditch intervention late in the game with Werner ready to slide in Abdellaoue for a Stuttgart goal.
But in the second minute of stoppage time, Bayern completed the feat with Thiago producing a sterling bicycle kick to break Stuttgart’s hearts.
The Bayern juggernaut marches on to 43 games unbeaten and they did break another record: scoring in 27 consecutive away matches, beating a mark previously held by Hamburg.