Yutaro Oda scored a late winner as spirited Hearts produced a rousing fightback from two goals down to beat Dundee 3-2 and move eight points clear in third place in the Scottish Premiership.
The Jambos looked in trouble when they trailed at the break through goals from Jordan McGhee and Lyall Cameron.
But they turned things around with second-half goals from Calem Niewenhof, recent recruit Dexter Lembikisa and substitute Oda.
Captain Lawrence Shankland would have been particularly relieved with the outcome as he saw a penalty saved by Trevor Carson at 2-1 down.
Shankland was back to lead the team after he missed Saturday’s Scottish Cup win at Spartans through illness, while goalkeeper Zander Clark was restored to the starting XI after being rested at the weekend to allow the fit-again Craig Gordon to get a first outing in 13 months under his belt after injury.
Dundee goalkeeper Carson returned after missing the Scottish Cup defeat at Kilmarnock, while on-loan Burnley left-back Owen Dodgson made his first start after a debut appearance off the bench at Rugby Park.
After a cagey opening 10 minutes in which both sides tried to adapt to the swirling wind around Tynecastle, Hearts pair Kenneth Vargas and Nieuwenhof threatened in quick succession with shots from the edge of the box.
Stephen Kingsley then glanced a free header wide from Alex Cochrane’s corner in the 15th minute.
Dundee went ahead in the 19th minute, just seconds after Clark had pulled off an excellent save to keep out Zach Robinson’s header from an Amadou Bakayoko cross.
Former Hearts player McGhee pinged a lovely finish beyond the Jambos keeper from just inside the box after Bakayoko cushioned Dodgson’s cross back into his path. The goal was initially ruled out for offside but allowed to stand after a VAR check.
Shankland and Vargas both spurned good chances to bring the hosts level before Dundee doubled their lead in the 38th minute.
Dara Costelloe seized on some loose play from Hearts and nicked the ball off Lembikisa just outside the box before slipping a pass through to Cameron who slotted low past the exposed Clark.
Hearts – booed off at the break – began the second half with renewed intensity and purpose, however, and got themselves back in the game in the 57th minute through a low 25-yard drive from Nieuwenhof.
The Jambos were given the chance to equalise in the 65th minute when they were awarded a penalty after Dodgson was deemed to have shoved Shankland as he tried to get on the end of a Kingsley cross, but Shankland missed his third spot-kick in succession as Carson got down to his right to make the save.
Hearts were not to be denied, though. They eventually got themselves level in the 74th minute when Lembikisa – making his first start since joining on loan from Rotherham – headed home Alan Forrest’s cross from the left.
The winner came in the 86th minute when substitute Oda turned and fired high past Carson, with the aid of a deflection off Joe Shaughnessy, after being fed by Forrest just inside the box.
What the managers said
Hearts manager Steven Naismith:
“Our second-half performance was really good. We got chances early and scored a good goal, and we used that momentum and pressure.
“For most of the second half it was attack v defence and we made the right choices when we got good opportunities
“The first-half performance was terrible. We were laboured, slow and played into Dundee’s hands. At half-time this place was toxic.
“The players knew it wasn’t good enough, we knew it wasn’t good enough and the fans let us know it wasn’t good enough, so you are in a really tough spot.
“For us to come back to win is a really good strength to have, that’s twice we’ve been 2-0 down here and we’ve taken points from both games. That probably wouldn’t have happened in previous seasons.”
Dundee manager Tony Docherty:
“It feels like I witnessed two teams out there. I couldn’t be more happy with the first half, they executed the game plan to the letter.
“I thought we started the second half well but we got caught up. They will learn the hard way from this. It’s important to make key decisions but that cost us tonight.
“We were the architects of our own downfall but we have to focus on the positives and learn to manage games better.”
What’s next?
Hearts’ next Scottish Premiership match is at home to Aberdeen on Saturday, while Dundee are away to Livingston.
Both games kick off at 3pm.