The Poland forward, who is now the league's top scorer with nine, netted three times in 18 minutes to help lift Dortmund to 28 points, two ahead of Bayern Munich who play on Saturday.
Stuttgart, who suffered their first defeat in eight league games under coach Thomas Schneider, took an unexpected early lead when Karim Haggui headed in Alexandru Maxim's corner but their joy was short lived.
Dortmund, who host Arsenal in the Champions League next week, reacted almost instantly, scoring twice in three minutes to go in front as they left the Stuttgart defence in tatters with their pace.
Defender Sokratis Papastathopoulos levelled with a well-taken header in the 19th minute before Marco Reus slotted in his sixth league goal after a solo run.
"We could have been up 2-0 before we let in the goal," said Dortmund coach Juergen Klopp, who on Wednesday extended his deal with the club to 2018.
"We started really well and we fought for every ball. Then we got the equaliser and it all started to roll for us. We had some brief concentration lapses but we quickly turned it around."
In front of a sold-out 80,000 crowd that refrained from lighting flares, unlike last week against Schalke, Dortmund picked up where they left off nine minutes after the break with Reus turning provider with a flick for Lewandowski to slot in.
He completed his hat-trick in the 72nd after Jakub Blaszczykowski's shot was palmed on to the bar by Ulreich and Lewandowski beat Stuttgart's defenders to the ball to tap in.
"We are very satisfied because we did exactly what we set out to do," said Lewandowski, who is set to leave after this season and has said he will announce his new club in January.
"Now we need to shift focus to the Arsenal game where we also want to get the three points," he added of Wednesday's clash in Champions League Group F where both teams have six points along with Napoli in a three-way tie at the top.
Dortmund substitute Pierre-Emerick Aubameyang got his seventh goal of the campaign when he lobbed Ulreich in the 81st minute as the hosts matched their club record of six straight home wins since the start of the season.
Treble winners Bayern Munich visit Hoffenheim where they will look to stay unbeaten for a 36th straight game and equal a 30-year-old Bundesliga record set by Hamburg in 1982/83.
Third-placed Bayer Leverkusen, a point behind Bayern, travel to bottom side Eintracht Braunschweig also on Saturday.
- Sports & Recreation
- Bayern Munich