The champion was held to a 1-1 draw by Werder Bremen last weekend and although normal service was resumed at Mercedes-Benz Arena, it did not have it all its own way against Pellegrino Matarazzo's side.
Stuttgart could easily have added to Tanguy Coulibaly's opener midway through the first half but Hansi Flick's men powered back to claim maximum points through fine strikes from Coman and Lewandowski before the break and a late third from Douglas.
The result means Bayern has won 26 of its past 29 top-flight games and helped it open a two-point lead at the Bundesliga summit after Borussia Dortmund dropped points at home to Cologne.
Bayern, which hit the post through Lewandowksi after three minutes, fell behind in the 20th minute when Manuel Neuer failed to cut out Silas Wamangituka's low cross, allowing Coulibaly to slot home his first ever professional goal.
Philipp Forster twice came close to extending the hosts' lead soon after, clipping narrowly past the post from close range and then firing straight at Neuer after being played clean through.
Those misses came back to haunt Stuttgart, with Bayern drawing level seven minutes before the interval when Coman tucked into the bottom-left corner after a flowing counter-attacking move.
Forster then had an effort ruled out after Coulibaly had fouled Neuer before Lewandowski put Bayern ahead in first-half stoppage-time, the Poland international drilling past Gregor Kobel from just outside the penalty area.
The game slowed down dramatically after the restart, with the next sight of goal not coming until the 72nd minute when Orel Mangala's attempt was deflected narrowly wide.
Waldemar Anton and Mateo Klimowicz then went close for Stuttgart but Douglas ensured a 19th win in 20 games for Bayern over its host three minutes from time, clipping into the bottom corner from 15 yards for his first goal since returning to the club on loan from Juventus.