Haaland drove Dortmund ahead from 20 yards after just 74 seconds and then turned home Thorgan Hazard’s cut-back.
But Lewandowski steered in Leroy Sane’s cross and levelled from the spot after Mahmoud Dahoud fouled Kingsley Coman.
Leon Goretzka drilled Bayern ahead late on before Lewandowski’s third confirmed a return to the top of the Bundesliga.
Victory moved Hansi Flick’s reigning champions two points clear of second-placed RB Leipzig, who had briefly climbed above them by winning at Freiburg earlier on Saturday.
Dortmund, meanwhile, drop a place to sixth, four points off the Champions League places, their woes compounded by a knock to Haaland that forced the Norway striker off in the second half.
He joins England winger Jadon Sancho on the treatment table, the England winger absent with a thigh injury, and Dortmund will be desperate for both to be fit by Tuesday as they bid to protect a 3-2 first-leg advantage against Sevilla in the Champions League last 16.
Haaland’s two early strikes amazingly brought his career tally to 100 senior goals in all competitions at the tender age of 20.
He has taken just 145 matches to reach that milestone – by comparison, Kylian Mbappe took 180 matches to rack up triple figures, Lionel Messi 210 games and Cristiano Ronaldo 301.
His second-minute opener took a slight nick off Boateng but was always heading for Manuel Neuer’s bottom corner and he ended a classy move by sweeping home Hazard’s pass for Dortmund’s second.
However, Lewandowski was not to be overshadowed, his hat-trick taking his Bundesliga total to 267 goals, one behind second-placed Klaus Fischer on the league’s all-time scoring charts.
The Poland striker could have had more against his former club, snatching at a volley that he sent wide before converting Sane’s centre from close range and beating Marwin Hitz from the spot.
Dortmund looked set to see out a cagier second half but Goretzka and Lewandowski both found the bottom corner with accurate finishes in the closing stages to continue Bayern’s hold over Dortmund – they have won the past seven meetings between the sides at the Allianz Arena by an aggregate of 30-5.