The Belgian side equalised with their first goal of this season's Champions League through captain Sofiane Hanni's close range finish 63 minutes in, but Corentin Tolisso's header 13 minutes from time ensured Anderlecht stay bottom of Group B with no points.
Bayern take lead despite hosts' numerous chances
Anderlecht boss Hein Vanhaezebrouck made six changes following their 2-1 win at Mouscron at the weekend as Frank Boeckx, Josué Sá, Henry Onyekuru, Massimo Bruno, Nicolae Stanciu and Hamdi Harbaoui made way for Matz Sels, Dennis Appiah, Kara Mbodji, Pieter Gerkens, Łukasz Teodorczyk and Hanni.
Jupp Heynckes made four changes to the side that beat Augsburg 3-0 on Saturday with Juan Bernat, Rafinha, Javi Martínez, James Rodríguez and Mats Hummels replaced by Tolisso, Thiago, Jerome Boateng, Marco Friedl and Sebastian Rudy.
Anderlecht got off to a flying start and should have found themselves in front after just eight minutes when Teodorczyk went clean through against Bayern keeper Sven Ulreich, only to see his effort blocked by the German.
The Belgian side continued to create chances early on as Hanni was the next to see an effort from the edge of the area kept out by Ulreich, who has been standing in for the injured Manuel Neuer this season.
Teodorcyk wasted the half's biggest chance on half-an-hour as he found himself in behind the Bayern defence thanks to Hanni's lofted ball, but the Polish forward fired wide to the relief of Ulreich.
Bayern's only real chance of the opening 45 came shortly afterwards as Lewandowski saw his goal-bound shot blocked following a scramble in the Anderlecht penalty area, moments before Teodorczyk headed Appiah's cross wide from 10 yards out.
The Polish striker wasted yet another chance five minutes before the break to spare Tolisso's blushes, the Frenchman playing a lobbed ball in behind his own defence to send Teodorczyk through but Ulreich was there once again to block the shot.
The other Polish striker on the pitch made Anderlecht pay for their missed chances six minutes after half time, as Rodríguez played the ball out to Tolisso on the right-hand side of the penalty area where the Frenchman squared for Lewandowski to tap home and put Bayern ahead.
Anderlecht fans given something to cheer with first goal of tournament
Anderlecht equalised just after the hour mark through captain Hanni, as Olivier Deschacht's cross was nodded down to the Algerian by Teodorcyzk and he made no mistake in smashing home from six yards.
The Bavarians should have regained the lead 72 minutes in via substitute Martínez, but the defender could only head Rodríguez's free-kick wide of Sels' goal from 10 yards.
Teodorczyk came close to putting the hosts in front with 15 minutes remaining but his shot from the edge of the area curled just wide of Ulreich's far post.
Heynckes' side got their noses back in front as Joshua Kimmich's excellent cross found the head of Tolisso who steered the ball past a stranded Sels and into the far corner.
Sels kept Anderlecht in the game five minutes from time as he tipped team-mate Kara Mbodji's goal-bound header around the post from Rodríguez's corner, sparing the defender's blushes.
Substitute Harbaoui thought he had rescued a point for the hosts at the death when he put Bruno's driven cross into the back of the net, only to be rightly halted in his celebrations by the offside flag.