Lawrence Shankland inspired Hearts to a second comeback victory over Dundee in 10 days.
The scoreline was the same as at Tynecastle in January with both Dark Blues scorers also the same in Jordan McGhee and Lyall Cameron.
But despite taking the lead twice, Tony Docherty’s side came away with nothing to show for their performance.
McGhee headed in on 26 minutes before Alan Forrest levelled 10 minutes into the second half.
Cameron then put Dundee back in front on 59 minutes before a contentious penalty on 79 minutes gave Shankland the chance to level again.
And the Scotland man made the Dee pay once again with the winner on 87 minutes.
First half
Michael Mellon made his first start for the Dee after shaking off a calf issue that ruled him out against Aberdeen.
And Luke McCowan returned from suspension as Mo Sylla and Zach Robinson dropped to the bench.
The opening 20 minutes drifted past with Hearts largely in possession but little goalmouth action before the contest kicked into life.
Shankland turned in the area but saw his shot clip the outside of the post.
Minutes later Amadou Bakayoko turned a McCowan cross goalwards but straight at Zander Clark before Forrest went up the other end and brought a strong stop from Trevor Carson.
That proved crucial as Dundee took the lead two minutes later.
McCowan was the man with the cross, sending an inviting ball into the centre and that man McGhee met it perfectly to head across goal and into the corner.
Twice in two weeks the former Hearts man opened the scoring against his old side.
And before the half-hour had passed there was another chance – McGhee meeting a Beck corner, Mellon flicking goalwards only to be denied by Shankland on the line.
After that flurry the chances died down again before the break with Hearts enjoying the lion’s share of possession.
But there was no way past the home backline as Dundee took their lead into the break.
Second half
The lead didn’t last long, however. With 55 minutes on the clock, Shankland worked some magic and worked his team back into the game.
Turning Joe Shaughnessy first, the Scotland striker beat another two men before Forrest turned the ball beyond Carson for 1-1.
Four minutes later, however, and Dundee had the lead again.
A lovely passing move through Bakayoko, McCowan and Cameron gave the latter space to shoot from 25 yards and the Scotland U/21 international made the most of it by smashing a fierce effort into the back of the net.
Then came the contentious penalty decision.
Shankland turned and volleyed, the ball hit Lee Ashcroft at very close range and bobbled through to Carson.
Referee Graham Grainger pointed straight to the spot and despite Dundee protests, VAR agreed it was handball.
Shankland took the spot-kick and scored, just. Carson got a hand to it but could only turn it onto the post.
Substitute Zach Robinson then had the chance to regain the lead, first seeing a good shot saved and then moments later fluffing a gilt-edged header.
And that would proved costly as Shankland worked yet more magic on 87 minutes to give his side the lead for the first time in the game.
A lead they wouldn’t be giving up.
Player Ratings
Dundee FC: Carson 7, Ashcroft 6, Shaughnessy 6, Dodgson 7, McGhee 7, Beck 7, Boateng 6, McCowan 7, Cameron 7, Bakayoko 6, Mellon 7 (Robinson 65, 6).
Subs not used:Â Legzdins, Sharp, Astley, Tiffoney, Main, Mulligan, Robertson, Sylla.
Hearts: Clark, Kent, Baningime (Tait 72), Grant (Fraser 60), Nieuwenhof, Shankland, Oda (Vargas 60), Forrest, Cochrane, Sibbick, Lembikisa.
Subs not used:Â Gordon, Halkett, Denholm, Pollock, Tagawa, Wilson.
Referee: Graham Grainger
Attendance: 7,506
Conversation