After late heartbreak in their previous two matches, there was late joy for Dundee at Livingston.
Scott Wright produced a stunning 83rd minute winner to secure a vital victory for the Dark Blues.
The loan forward’s 25-yard free-kick completed a comeback win after Dundee went a goal behind to a Craig Halkett opener on 18 minutes.
By that point Livi were down to 10 men, with Shaun Byrne ordered off for a high tackle on Andy Dales.
Andrew Nelson’s fourth goal for the club levelled the scores on the 54th minute but the game looked to be heading for a frustrating draw until Wright gave Liam Kelly no chance with his set-piece.
Seny Dieng also played his part with a superb double save in the dying moments.
The win takes Dundee out of the bottom two. They are level on points with Hamilton Accies but have a better goal difference.