Jupp Heycknes saw his side come out on top in a topsy-turvy encounter in what was his final league outing as the Bavarians' coach, with Franck Ribery the star of the show
The Bavarians were two down inside five minutes, with Martin Stranzl and Mike Hanke on target for the hosts, and although the champions immediately pulled a goal back through Javi Martinez, Havard Nordtveit restored die Fohlen's two-goal advantage just as quickly.
However, Franck Ribery then dragged his side back into the game with a low strike before levelling matters in the second half with a stunning volley. The Frenchman was involved again as Arjen Robben volleyed home to decide a remarkable game in the visitors' favour.
Bayern had gone into the game having conceded just 15 goals in their previous 33 outings in this season's Bundesliga. They shipped three inside the opening 11 minutes at the Borussia Park.
Bayern's much-vaunted backline was breached for the first time just three minutes in, with Stranzl enjoying the freedom of the penalty area as he headed home Juan Arango's in-swinging free kick from the right-hand side.
The hosts surprisingly doubled their advantage just two minutes later when Hanke finished with aplomb after being slipped in on goal by strike partner Branimir Hrgota.
Bayern posted an almost instanteous reply, with Martinez coolly rolling the ball past Marc-Andre ter Stegen, after taking a terrific first-time lay-off from Ribery in his stride, but Gladbach restored their two-goal lead soon after through Nordtveit.
Arango was involved again, this time releasing Patrick Herrmann with a sublime outside-of-the-foot pass. The German fed the ball inside to Nordtveit and he coolly stroked it past a shell-shocked Manuel Neuer.
Bayern were in complete dissarray at the back, but Ribery was doing his utmost at the other end to keep them in the game, and he made it a one-goal game on 18 minutes by beating Ter Stegen at his near post with a low strike from just inside the area.
The second goal belatedly settled Bayern, who dominated the remainder of the half and could well have gone in level at the interval, with Bastian Schweinsteiger, Ribery and Arjen Robben all going close with well-struck efforts.
Monchengladbach remained an attacking threat, though, and the lively Hrgota, fresh from his hat-trick at Mainz last weekend, fired just wide from the edge of the area during what was a bright spell for the home side just after the break.
However, that did not stop Bayern from equalising on 54 minutes. Indeed, nothing could have stopped Bayern from equalising, with Ribery beating Ter Stegen all ends up with a blistering volley from a Philipp Lahm cross.
Arango nearly put Gladbach back in front with a swerving set piece that very nearly deceived Neuer, but it was, almost inevitably, Bayern who went 4-3 ahead instead, with Robben calmly sidefooting home a volley, after being picked out at the back post by the irrepressible Ribery.
Monchengladbach were stunned and, in truth, never looked remotely like turning the game around, with Bayern ultimately cruising to a deserved victory in Jupp Heynckes' final Bundesliga game at the helm.