After securing a sixth straight German league title last weekend and booking a Champions League semi-final place in midweek, this was another dominant display from Bayern, who have a German Cup semi-final at Leverkusen on Tuesday.
Wagner, the back-up at Bayern for star striker Robert Lewandowski who was on the bench, has scored seven goals in his last eight games.
"I'm having fun, I'm in the form of my life and assume I'll be at the World Cup this summer," said Wagner.
Gladbach, who beat Bayern 2-1 at Borussia Park last November, silenced the crowd when Josip Drmic cut inside defender Niklas Suele to fire home with nine minutes gone.
However, Wagner tapped home the equaliser after good work from Thomas Mueller on 37 minutes, then added a second with a superb header four minutes later.
Bayern increased their lead on 51 minutes as Thiago Alcantara drilled home the rebound after Gladbach goalkeeper Yann Sommer blocked an attempt from Wagner.