Ramy Bensebaini scored an injury-time penalty as Borussia Monchengladbach beat Bundesliga champions Bayern Munich 2-1 in a thrilling top-of-the-table clash on Saturday.
Bayern, who lost at home to Bayer Leverkusen last weekend, dominated the first half but could not open the scoring until shortly after the restart, Ivan Perisic on target with a fine finish.
Their lead was short-lived at Borussia-Park, however, as Bensebaini's header drew Gladbach level within 11 minutes to set up a gripping finale.
Javi Martinez conceded a late penalty for fouling Marcus Thuram - and was sent off - with Bensebaini staying cool to beat Manuel Neuer and leave Bayern seven points behind leaders Gladbach.
Thomas Muller and Robert Lewandowski missed early chances as Bayern made a bright start.
Interim head coach Hansi Flick reshuffled his Bayern side when Corentin Tolisso went off injured and Perisic replaced the midfielder, makeshift left-back Alphonso Davies having shaken off an early blow to his knee.
Yann Sommer made a fine save to his left from Muller's 20-yard strike, before the goalkeeper was lucky not to concede when he misjudged Joshua Kimmich's drive and recovered to stop the ball on the line.
Perisic missed a good chance before half-time, but the substitute broke the deadlock in the 49th minute, swivelling to thump home from just inside the box with Sommer unable to keep it out despite getting his right hand to the volley.
Gladbach levelled on the hour mark against the run of play, though, Bensebaini powering home a towering header from Jonas Hofmann's right-wing corner.
Both sides spurned chances to win the game before Martinez, who came on for Jerome Boateng in the 68th minute, brought down Thuram with seconds of normal time remaining.
Martinez was shown a second yellow card and, despite being made to wait to take the kick, Bensebaini squeezed the penalty past Neuer's desperate dive to keep Gladbach's unlikely title charge on track and leave Bayern considering Flick's future.
What does it mean? Bayern fall further off the pace
Marco Rose's Gladbach went into the weekend as the leaders, but this was their biggest test of the season so far. They struggled to contain Bayern for the most part but a string of missed opportunities would cost the champions. It was a smash-and-grab win for the hosts.
With three games to go until the mid-season break, Bayern's hopes of topping the table at that point now look remote.
Bensebaini keeps his cool
It is hard to underplay how much pressure was on Bensebaini's shoulders when he stepped up to take a penalty needlessly conceded by Martinez. Failing to convert could have proven a blow to Gladbach's title hopes, while securing victory would offer a huge confidence boost. The defender stayed calm to steer his kick just inside the post to beat Neuer, having already scored an excellent header to equalise.
Martinez makes a mess
The usually reliable Martinez made a terrible cameo off the bench having replaced the injured Boateng. Already booked for a foul on Lars Stindl, he lunged in on Thuram, who seemed to be going nowhere, to leave referee Marco Fritz no choice but to point to the spot. That moment might just be defining in this season's title race.
Bayern host Tottenham in the Champions League on Wednesday having already confirmed top spot in the group, with Gladbach at home to Istanbul Basaksehir on the closing matchday of the Europa League group stage the following day. Next weekend, Bayern will try to get back to winning ways in the Bundesliga when they host strugglers Werder Bremen. League leaders Gladbach go to Wolfsburg.