Full-strength Bayern conceded the first goal after just 71 seconds and were 3-0 down with 21 minutes played.
It was the first time for 27 years Bayern have conceded so many goals so early in any competition.
It is Bayern’s heaviest German Cup defeat, eclipsing a 5-1 quarter-final defeat at Cologne in 1972.
French midfielder Kouadio Kone grabbed his first goal for Gladbach with barely a minute gone, then Algerian defender Ramy Bensebaini and Swiss striker Breel Embolo both scored twice in the rout.
We’re out of the DFB-Pokal. https://t.co/O6MJrb7vJd
— FC Bayern English (@FCBayernEN) 1635366981000
This is the second time in consecutive seasons Bayern have been dumped out of the cup in the second round having lost at Holstein Kiel last January after a penalty shoot-out.
There were plenty of off-field distractions for Bayern in the build up.
Hours before kick-off, France defender Lucas Hernandez heard he will escape being jailed in Spain for violating a restraining order in 2017 after a Madrid court accepted his appeal.
Midfielder Joshua Kimmich has also been the centre of fierce debate in Germany after revealing he opted against being vaccinated for Covid-19.
Bayern head coach Julian Nagelsmann was missing as he remains in isolation at home after testing positive for the coronavirus.
Moenchengladbach completely dominated the opening exchanges by converting two of their six shots on goal.
In contrast, Bayern, top of the Bundesliga table while Gladbach are 12th, failed to get a shot on target in the opening 20 minutes.
Gladbach took an early lead when a sloppy pass by Alphonso Davies near his own area was snapped up by Kone, who traded passes with Embolo and fired home.
There was pure delight in the stands at Borussia Park when Bensebaini fired the hosts’ second goal past Manuel Neuer on 15 minutes.
A penalty was awarded when Hernandez went in high against Embolo and Bensebaini sent Neuer the wrong way to make it 3-0 at half-time.
This is the second time Bensebaini has terrorised Bayern after the 26-year-old scored both goals in Gladbach’s 2-1 home Bundesliga in December 2019.
Embolo then compounded Bayern’s misery with two rapid-fire goals within six minutes of each other to make it 5-0 after 57 minutes.
The celebrations started with ten minutes left as delighted home fans sang ‘Oh, wie ist das schoen’ (Oh, how beautiful this is).
Earlier, Bundesliga side Bayer Leverkusen also suffered a cup upset when they were beaten 2-1 at home by second division Karlsruhe.
South Korean forward Choi Kyoung-rok hit the winner in the second-round tie.
Holders Dortmund are already into Sunday’s draw for the third round after their 2-0 win at home over second-tier Ingolstadt Tuesday.