The league's top scorer, who also scored one goal and set up another last week, struck twice in seven minutes early in the second half to take his tally to 14 as the Bavarians won for the 16th time in 20 games.
Thomas Mueller had given the visitors a 40th-minute lead against the run of play with his 11th league goal of the season.
"We knew it would be a hard game and we prepared very well for it," Bayern coach Jupp Heynckes said.
"We showed that we have fun playing football. This was a big win towards the title," said the German who will make way for former Barcelona coach Pep Guardiola next season.
Sixth-placed Schalke's new signing Michel Bastos scored on his debut but it was not enough as the Champions League last-16 qualifiers slumped to a 2-1 home defeat by bottom club Greuther Fuerth thanks to Nikola Djurdjic's last-gasp goal.
It was Fuerth's second league win of the season, and their first since August.
Mainz, fifth on 30 points, were the livelier side at the start as they took the sting out of Bayern's game with incessant pressure and quick breaks.
With Mainz now trying to play catch-up, Bayern had far more space and it did not take long before they made it count.
Mueller sent captain Philipp Lahm through on the right and his cross was met by Mandzukic as he headed his second goal at the far post in the 57th minute.
Lakic, whose career had stalled at Wolfsburg after he rose to prominence with Kaiserslautern, hit in the 22nd and 36th minutes in a debut to remember.
His team go level on points with third-placed Borussia Dortmund, who play on Sunday, while Hamburg stay ninth.
Fortuna Duesseldorf stunned Stuttgart 3-1 with two goals from Australian Robbie Kruse as they rose to 13th place and away from the drop zone.
Second from bottom Augsburg continued their improved start to the year, chalking up a third undefeated game in a row with a 1-1 draw at Wolfsburg.