Lucas Hernandez and Leroy Sane got the goals as the Bundesliga champions beat Barca in the Champions League group fixture at the Allianz Arena.
The Blaugrana have now failed to win in their last seven visits to Bavaria, recording two draws and five defeats and being outscored by an aggregate total of 16-4.
For Bayern, the win came after three consecutive draws in the league.
“Barca had the better chances in the first half. We had to rely on [keeper] Manuel [Neuer].
“After the break we were more aggressive. We quickly scored two goals. We basically won because of higher efficiency.
“From our side I am also happy Lewandowski did not score against us tonight,” Nagelsmann said.