The Croatian striker capitalised on a cross from Philipp Lahm, sending a powerful header past a diving Pilsen keeper Matus Kozacik in the 65th minute, only six minutes after coming onto the pitch.
Bayern have made it to the last-16 for the sixth time in a row, accompanied by Group D runners-up Manchester City who beat CSKA Moscow 5-2.
Bayern sit at the top of Group D with 12 points from four games, leading City by three points and CSKA Moscow by nine, with Pilsen stuck at the bottom with no points.
"We have taken all the points we could in the four games, which shows how strong we are," said Bayern coach Pep Guardiola. "We knew the game wouldn't be easy... in the second half we were able to create enough chances. I think the game was interesting," he added.
Bayern dominated the early minutes of the game as David Alaba forced a diving save from Pilsen's Slovak keeper Matus Kozacik from a free kick. Bastian Schweinsteiger hit the post with a low curling shot in the 16th minute and Kozacik stopped several good shots that got past the solid Pilsen defence.
Outshot 35-0 by Bayern in a 5-0 trashing in Munich two weeks ago, Pilsen vowed a braver performance in the home game and made good on the pledge as they put the Bundesliga leaders under some pressure half an hour into the game.
But Milan Petrzela sent a powerful left-footer just over the bar and Daniel Kolar followed suit with a header. "When Viktoria lost 5-0, it definitely meant they would be far more focused next time and want to get a better result," said Guardiola, hailing Bayern's defence.
Despite the loss, Pilsen coach Pavel Vrba praised his team for "showing its real face". "We were quite different than in Munich where Bayern humiliated us.
"Still, it wasn't an ideal performance because we didn't collect any points. But a game like this against a team like this will definitely give us a boost for games to come," said Vrba.
The hosts seemed to lose steam as Bayern almost scored three minutes after halftime but Lahm's shot was cleared by Pilsen defender Marian Cisovsky off the goal line.
Daniel Van Buyten sent his header past the Pilsen goal and Kozacik denied Franck Ribery's shot from close range before clearing another effort by Lahm a minute before the end.
But Pilsen did not give up and with 15 minutes left, striker Stanislav Tecl first forced a dive from Bayern keeper Manuel Neuer and then missed a perfect pass a few feet from a gaping net.
Bayern started with Mario Goetze on the right wing replacing an injured Arjen Robben while Diego Contento replaced Dante in the Bayern backline.
Guardiola sent Mandzukic and Javi Martinez into the game with an hour gone to boost the Bayern offence, and the move made all the difference.