Bayern's France defender Lucas Hernandez headed in a corner to open the scoring, but it was Sane who put the game beyond doubt for the home side.
Former Manchester City forward Sane, who scored one and created another in Bayern's 2-0 opening Champions League win at Inter Milan, helped turn the match, which was well in Barca's favour after a frantic opening half.
The Germany attacker scored Bayern's second in the 54th minute, chipping a ball over Catalan goalkeeper Marc Andre ter Stegen, just three minutes after Bayern's Hernandez headed in a corner from Joshua Kimmich to open the scoring.
"I think for Lewy it was really an emotional game to come back - a little bit like coming home, because he was so successful here," Bayern captain Manuel Neuer told Amazon Prime.
"The luck in the decisive moments wasn't on his side - and that became our luck.
"With his volley (in the 19th minute) we had a little bit of luck that it went over the crossbar. But I think we showed a really good defensive performance."
Lewandowski, greeted by warm applause from the home fans during the pre-game warm up, had several chances to open the scoring.
Lewandowski latched on to a dipping pass from Pedri in the 19th minute, but shot too high, just tickling the top of the crossbar.
Just one minute later the Poland forward again received the ball just metres from Bayern's goal, but his header was saved from close range by Manuel Neuer.
Raphinha, starting his first Champions League game after making the move from Leeds in the summer, drilled in a low shot past a stranded Neuer after 27 minutes, but the Brazilian missed the goal by inches.
In the dying stages of the half, Barca had appeals for a penalty waved away by referee Danny Makkelie when Alphonso Davies brought down Ousmane Dembele on the edge of the box, with replays showing the Canadian made clear contact with the Frenchman's legs.
At half-time, Bayern coach Julian Nagelsmann brought on Leon Goretzka for Marcel Sabitzer and the move almost paid immediate dividends, with the former's rocket from outside the box deflected out by ter Stegen for a corner, which Hernandez would score from.
Bayern travel to the Camp Nou for the return fixture on October 26.