A goal in either half from the champions was enough to ensure they took all three points at the Allianz Arena and maintained their unbeaten start to the season
The former France winger came off the bench to seal a deserved win for the champions with a well-taken late goal on his return from a knee injury.
Ribery, who this week stated he would not reverse his decision to retire from international football, had not featured since Bayern's DFB-Pokal final win in May, but he made up for lost time at the Allianz Arena.
Midfielder Mario Gotze, who scored Germany's winner in the World Cup final, found the back of the net for the first time this season for the Bavarian giants with a clinical first-half finish to put Bayern in front.
Xabi Alonso, making his home debut, and Robert Lewandowski both struck the post as Bayern secured a 12th successive win against Stuttgart, who had their chances but were unable to end their dismal run against the home side.
Bayern have now won two of their first three Bundesliga matches and were impressive ahead of their UEFA Champions League clash with Manchester City on Wednesday.
Armin Veh's Stuttgart side, on the other hand, are awaiting their first Bundesliga victory of the campaign.
Bayern's recent signing Mehdi Benatia was among the substitutes, while Pep Guardiola restored Dante and Juan Bernat to the starting line-up at the expense of Sebastian Rode and Xherdan Shaqiri.
Timo Werner and Moritz Leitner replaced Daniel Didavi and Alexandru Maxim in the Stuttgart starting line-up.
Bayern wasted little time in stamping their authority on the game and it took an agile save from Sven Ulreich to keep out Thomas Muller's header after Jerome Boateng picked the forward out.
Antonio Rudiger spurned an opportunity to give Stuttgart a shock lead when he headed wide at the back post and that miss proved costly, as Gotze put Bayern in front after 27 minutes.
The midfielder showed great composure to take a touch inside before rifling home with his right foot from around 10 yards out after Stuttgart failed to deal with a free-kick from Alonso.
Bayern were worthy of their lead, but were caught napping when Rudiger was left unmarked from a corner, only to again head off target.
The home side wanted a penalty for handball against Gotoku Sakai, but the referee waved played on and Bayern suffered a blow when Holger Badstuber picked up a thigh injury late in the first half and was replaced by Gianluca Gaudino.
Close-season signing Filip Kostic replaced Vedad Ibisevic at half-time as Veh attempted to get his side back into the game.
Bayern always looked dangerous going forward, though, and Lewandowski tried his luck with an acrobatic volley after demonstrating some excellent close control, but was off target.
Rudiger was presented with another golden opportunity when Bayern again left him unmarked from a free-kick, but he appeared to be caught in two minds and the chance had passed.
Ribery was given a great reception when he replaced Gotze after 67 minutes, then Alonso struck the post before Lewandowski was also denied by the woodwork.
Former Marseille man Ribery showed his class to seal the points two minutes from time, though, finishing with his left foot after Lewandowski played him in.