Dundee striker Simon Murray’s dramatic double earned the Dark Blues what could turn out to be a truly valuable victory.
Conor Sammon gave Partick Thistle the lead three minutes before half-time at Firhill but Murray levelled things on 84 minutes before netting the winner with just a minute left.
It was the former Dundee United man’s first strikes for the club and the three points they secured absolutely flattened the home side, who had seemed on course to win.
It was the polar opposite to what happened against Kilmarnock, when the Dark Blues chucked away a likely victory.
The Dark Blues rejigged their defence, with Darren O’Dea dropping down to the bench and Genseric Kusunga missing out through injury.
That meant places for Cammy Kerr, who took over the captaincy from O’Dea, and comeback man Josh Meekings.
After an opening spell bossed by the home side, on 10 minutes Roarie Deacon tried a shot from outside the box that Jags keeper Tomas Cerny had to push away.
A brilliant saving tackle from Meekings on 23 minutes stopped a likely Thistle goal when, from on the floor inside the box, the Dundee man flicked the ball away from Sammon just as he was about to shoot.
The hosts should have opened the scoring on 27 minutes when the ball broke to Martin Woods 12 yards out but he shot straight into the arms of goalie Elliott Parish.
On 31 minutes, Cerny had to pluck a curling shot from Simon Murray out of the air after the Dark Blues frontman burst in from the left.
The Jags goalie did well again five minutes later when he dived at the feet of Mark O’Hara to prevent the midfielder sneaking the ball inside the near post.
Dundee were now enjoying a decent spell and Deacon sent a strike whizzing past from 30 yards.
It was Partick, though, who took the lead with just three minutes of the first half remaining.
Sammon was the scorer, prodding the ball past Parish from close range after Ryan Edwards had headed down a Mustapha Dumbuya cross from the right.
Just after the restart, Meekings saved his side again when he somehow prevented Sammon from shooting after the Jags player ran through on goal.
On 50 minutes, the Dens men had a decent chance when some acrobatics from Sofien Moussa saw the big man’s attempted overhead kick fall for Murray, who fired wide at the back post.
With an hour gone, there was a great escape for the Dens men when Chris Erskine was able to turn and shoot inside the box but Parish stuck out a leg to make a fine stop.
Dundee, who replaced Moussa with A-Jay Leitch-Smith on 67 minutes, had an opportunity when the ball was floated towards Steven Caulker by O’Hara but the defender’s header flew wide.
A shot from O’Hara was deflected over as the visitors kept looking for a leveller.
With the clock showing 84 minutes, they duly got one.
Full-back Jon Aurtenetxe played in sub Leicth-Smith and his cross-shot landed perfectly for Murray, who slid the ball in at the far post.
Then, with just a minute left, Caulker was up for a corner and had an effort that hit two Thistle players before falling for Murray, who fought through the pack to nod into the net.
Partick Thistle: Cerny, Dumbuya, Booth, Cargill, Keown, Osman, Erskine (Spittal 70), Sammon, Edwards, Woods, Storey (Doolan 71). Subs not used: Scully, Lawless, Barton, Devine, Penrice.
Dundee: Parish, Kerr, Caulker, Kamara, Moussa (Leitch-Smith 67) O’Hara, Aurtenetxe, Murray, McGowan, Deacon (Curran 70), Meekings. Subs not used: Malherbe, O’Dea, El Bakhtaoui, Curran, Lambert.
Referee: Willie Collum.