Igor de Camargo scored deep into stoppage time to give Bundesliga club Borussia Monchengladbach a home victory in the first leg of their relegation tie against second division Bochum.
De Camargo, a 67th-minute substitute, scored the winner three minutes into stoppage time.
Gladbach, who finished 16th in the Bundesliga this season, are hoping to avoid their third relegation to the second division following 1999 and 2007.
Bochum, the third-placed finishers in the second division, would be moving to the Bundesliga for the seventh time in club history.
The return leg will be played in Bochum on Wednesday.
Gladbach had the first chance in the opening minute with Juan Arango's deflected header from seven yards going just over the crossbar.
Bochum were close five minutes later but Gladbach's Filip Daems headed Anthar Yahia's attempt from 12 yards away at the line.
The hosts controlled the rest of the first half but Dante's header from a corner went just over the frame of the goal from eight yards after 25 minutes.
And Bochum goalkeeper Andreas Luthe made a superb save on Mike Hanke nine minutes later following a counter attack.
The guests rarely ventured forward though Umit Korkmaz unleashed a long blast just over the crossbar in the 63rd minute.
Luthe again kept his team in the game with another fine stop from Hanke's header 11 minutes later.
Dante was again just off target with a header from a corner with six minutes to play and Luthe got a finger on Hanke's header three minutes later to keep a clean sheet.
Luthe then stopped De Camargo deep in stoppage time but the ball came back to the Belgian international, who struck the winner from four yards out.