Thomas Mueller put Bayern ahead with a first-half header and Adam Szalai equalised before Lewandowski’s spot-kick and a late Arjen Robben goal sealed victory at the Allianz Arena.
Both teams seem to have suffered serious injury setbacks as Bayern winger Kingsley Coman and Hoffenheim captain Kevin Vogt had to be helped off.
New Bayern coach Niko Kovac got his side’s bid for a seventh straight title off to a winning start in his first league game.
But Hoffenheim had every reason to complain about Bayern’s second goal on 82 minutes.
“That wasn’t clear cut,” admitted Bayern boss Kovac, “I wouldn’t have given it”.
Replays showed Hoffenheim defender Havard Nordtveit made no contact with Franck Ribery, yet Bayern were awarded the penalty and when Lewandowski had his initial shot saved, Robben netted the rebound.
However, the penalty had to be retaken as replays showed Robben ran into the area too soon and Lewandowski scored at the second attempt.
“We put in some brutal pressure until the penalty — which wasn’t one,” fumed Hoffenheim coach Julian Nagelsmann.
“I don’t know where the video assistant referee (VAR) was for that, apparently they weren’t at their places. It was marginal.”
Mueller then had a goal ruled out for striking his elbow before Robben made sure of the three points with Bayern’s third goal on 90 minutes.
Kovac sprung a surprise before kick-off by starting with Germany centre-back Mats Hummels, 29, and Robben, 34, on the bench.
Defender Niklas Suele and Coman, both 22, took over in the starting line-up.
Mueller responded to sharp criticism of his poor performances at the World Cup, when Germany crashed out after finishing bottom of their group, with a superb header from a corner in the 23rd minute to claim the first goal of the season.
Hoffenheim wasted a golden chance moments later when Joelinton fired wide with only goalkeeper Manuel Neuer to beat.
The hosts should have gone 2-0 up when Coman fired straight at Hoffenheim ‘keeper Oliver Baumann on 37 minutes, before having to be helped off after taking a heavy knock on the ankle in a foul by Hoffenheim defender Nico Schulz.
The referee initially missed the incident, but after VAR intervened, Schulz was booked and Robben replaced Coman.
It stayed 1-0 at the break, but Hoffenheim drew level following two errors in the Bayern ranks after Javi Martinez gave away possession weakly.
Hoffenheim striker Szalai powered into the box, held off Martinez’s challenge and turned Boateng to fire home on 57 minutes.
Martinez made way for Leon Goretzka with 25 minutes left as Kovac put more emphasis on attack, and Hoffenheim lost Vogt when he landed awkwardly after a challenge.
And after the VAR drama, Robben made sure of the points by darting onto a through ball and firing home for the defending champions.