Bayern appeared to be cruising when a harsh penalty, converted by Thomas Mueller, and two Mario Gomez goals put them 3-0 ahead inside 61 minutes.
Stuttgart, hammered 6-1 by the Bavarians in the Bundesliga, then gave them a real scare as Martin Harnik pulled two goals back.
Bayern hung on to complete a memorable season and give departing coach Jupp Heynckes the best possible send-off as he ended his third stint in charge to make way for former Barcelona supremo Pep Guardiola.
They became the seventh team to win their league, cup and European Cup in the same season, following Inter Milan (2010), Barcelona (2009), Manchester United (1999), PSV Eindhoven (1988), Ajax Amsterdam (1972) and Celtic (1967).
Just as in last week's 2-1 Champions League final win over Borussia Dortmund, Manuel Neuer prevented Bayern falling behind with some outstanding goalkeeping.
Stuttgart nearly took an early lead when Alexandru Maxim hooked Ibrahima Traore's swerving cross just wide of the post from 12 metres.
Maxim then floated over a free kick and it was diverted towards his own goal by Bastian Schweinsteiger.
Neuer blocked at close range, then dived at the feet of Georg Niedermeier as he tried to scramble the ball in.
Bayern were awarded a soft penalty when Philipp Lahm burst into the box and his legs crumpled as he went shoulder to shoulder with Traore, Mueller burying the spot kick to open the scoring in the 37th minute.
The Bavarians went two ahead in the 48th minute when Lahm's low cross was scrambled into an empty net by Gomez.
Gomez's second goal in the 61st minute was far more convincing as he swept home Mueller's low cross from the right.
It seemed to be all over but Stuttgart, who finished 12th in the Bundesliga after an indifferent second half to the season, had other ideas.
Harnik headed one back in the 71st minute and substitute Shinji Okazaki was sent clean through minutes later only for Neuer to save his weak effort.
Stuttgart had a penalty appeal turned down before Harnik struck again with 10 minutes left.
Okazaki's low shot struck the post, Harnik's first attempt from the rebound was saved by Neuer and the ball went straight back to the Austrian who buried his second effort.
Neuer made another save deep into stoppage time when he stopped Serdar Tasci's header.