SC Freiburg had an 89th-minute equaliser ruled out by VAR as Leonardo Bittencourt set relegation-threatened Werder Bremen on their way to a crucial three points at the Schwarzwald-Stadion.
Bremen, who had seen Philipp Bargfrede dismissed moments earlier, were left immensely relieved to end their seven-game winless drought and move within two points of Fortuna Dusseldorf in the play-off spot.
Story of the match
A pleasingly competitive first half began with a stretching save from Jiri Pavlenka after Vincenzo Grifo's free-kick from the left edge of the penalty area.
At the other end, Alexander Schwolow's first test was to gather a side-footed effort from Davy Klaassen after the ball broke kindly for the Dutchman 18 yards out.
Freiburg then fashioned the game's first big opportunity at the end of a swift counter-attack as Nils Petersen, twice a scorer in the reverse fixture, found room at the back post and chested the ball down to Roland Sallai, who fired wide on the half-volley.
It would only be two minutes before Sallai was left to rue his miss. The impressive Marco Friedl regained possession for Bremen and played it into Klaassen, who swung an excellent first-time ball into an unmarked Bittencourt. He set himself, and then found the far corner with an accomplished finish for his third Bundesliga goal of the season.
Theodor Gebre Selassie scored for Bremen on Monday night against Leverkusen, but this time he had to be on hand to make a goal-saving contribution, sliding in to thwart Lucas Holer after he burst through a gap in the defence.
There was little in the way of openings for the remainder of the half, though the leaders did suffer a blow when Kevin Vogt was forced off injured 10 minutes before the interval.
Bremen started the second half on the front foot, with Friedl driving down the left side of the area and looking to tee-up a second with a cut-back from the byline, but there was no white shirt on hand to convert.
Then the game then settled into a pattern, with Freiburg applying plenty of pressure but encountering a resilient Bremen backline.
Pavlenka made two good saves within the space of five minutes, denying Sallai from a tight angle and then getting down to his right to meet Nicolas Hofler's fierce 20-yarder on the hour.
Die Werderander's lead looked fairly secure until the 88th minute, when Vogt's replacement Bargfrede received a second yellow for tripping Holer on the right flank.
The resulting free-kick was initially cleared, but Freiburg dug out a second cross, this time reaching Petersen at the back post. He fizzed one across goal and off the woodwork, and Bremen hearts sunk as Manuel Gulde tapped the rebound into an unguarded net.
The mood was swiftly transformed, however, as replays showed Petersen to be half a yard offside, and VAR chalked off the hosts' equaliser.
There were still six added minutes for Florian Kohfeldt's men to negotiate, but they hung on thanks to another Pavlenka stop from Petersen's last-gasp strike.
Bremen's fighting spirit may yet bring salvation
It has been a wretched campaign for Werder Bremen, and it will take performances and results like this to salvage it.
Any manager battling relegation would relish such a display. They were devastatingly clinical when their big chance arrived in the first half and in the second they were superbly dogged. This was only their second victory of 2020, but it was richly deserved.
With a tricky game against Borussia Monchengladbach to come, they simply needed a win here. And thanks in part to a perfect use of VAR, they got one. Dusseldorf will be sweating in the knowledge that their rivals have a game in hand.
Man of the match - Jiri Pavlenka
Pavlenka had only managed a single clean sheet this season before today, and he had to work very hard to double that tally.
He stood up to every test he faced and, crucially, did not allow Freiburg any scraps when powerful low shots came his way.
Gladbach visit the Weserstadion for a 19.30 kick-off on Tuesday, while Freiburg, who remain seventh and two points behind Wolfsburg, take on Frankfurt at the same time.