Gnabry scored either side of half-time before the flood gates opened with three goals in a devastating five-minute spell including two by Lewandowski in quick succession.
Bayern head coach Julian Nagelsmann promised to supply beers for the ride home - "we always have a crate on the bus" - then poured praise on Gnabry - "an outstanding player" - who had a role in all five goals, including two assists for Lewandowski.
The Poland striker took his tally to 18 goals in 16 league games this season as Bayern earned a 10th straight Bundesliga win at Stuttgart dating back to 2009.
"Bayern can dismantle teams. Not only in Germany, but also internationally," said Stuttgart sports director Sven Mislintat.
"We were taught a lesson after they went 3-0 up - they've incredible quality."
The Bavarian giants remain on course to win a 10th consecutive Bundesliga title, but second-placed Borussia Dortmund can trim the lead when they host bottom side Greuther Fuerth on Wednesday.
Injuries and illness meant Bayern again fielded Jamal Musiala, 18, out of position in the defensive midfield alongside Marc Roca. They then lost winger Kingsley Coman to a leg knock in the opening half hour.
Coman's replacement Leroy Sane set up Gnabry's opening goal by charging through a gaping hole, which grew wider when Stuttgart centre-back Waldemar Anton lost his footing.
Sane squared to Stuttgart-born Gnabry who curled his shot around home goalkeeper Florian Mueller to make it 1-0 at the break.
Stuttgart raised the tempo at the start of the second half as strikers Philipp Foerster and Omar Marmoush both had chances, but it was virtually one-way traffic from Bayern thereafter.
The visitors doubled their lead when Marmoush yielded possession and the ball was moved to Gnabry who again curled his shot around the diving Mueller.
Stuttgart's defence capitulated as Bayern scored three goals in five devastating minutes.
It started when Gnabry's long-range pass picked out Lewandowski who chipped Mueller.
Moments later, Gnabry dribbled into the box and set up Lewandowski who tapped home with a well-timed slide.
Bayern were now in full flow.
Gnabry claimed the second Bundesliga hat-trick of his career when he slotted home after Thomas Mueller's shot had been parried by Stuttgart's luckless goalkeeper.