Dundee were determined to show they were a different team to the side that was trounced at Tynecastle on the opening day of the Championship season.
They achieved that with a display that had the Jam Tarts worried but still lost to sit 18 points behind the hosts.
Hearts took the lead through Andy Halliday on 35 minutes, with Armand Gnanduillet making it 2-0 on 58 minutes.
Jason Cummings scored from the spot to bring Dundee back into it but, despite a few near things, they couldn’t find an equaliser.
The visitors had suffered a 6-2 loss back on October 16 but there was never any danger of a similar scoreline this time, with not much between the sides over the 90 minutes.
James McPake’s men were unchanged from the side that beat Inverness Caley Thistle 2-1 at Dens on Tuesday night.
Paul McMullan made a lively start for Dundee and his cross on eight minutes was met by Cummings, whose header was saved by home keeper Craig Gordon.
The hosts seemed to wake up and started firing crosses and long throws into the Dark Blues’ goalmouth.
Hearts’ frontman Gnanduillet had a shot deflected wide on 18 minutes before Aaron McEneff sent a low drive wide of the post from 30 yards.
The home team struck the woodwork on 23 minutes when Halliday tried a cross-shot from 20 yards that clipped the post.
The Jam Tarts were in the ascendancy and Liam Boyce pulled a low strike just wide on 29 minutes.
There was a massive let-off for the visitors – and huge embarrassment for Gnanduillet – when the home striker seemed set to tap the ball into the net from just a couple of yards out but scooped his shot into the air instead.
However, the opener was delayed by just a minute when Halliday edged Hearts ahead.
With 35 minutes on the clock, he pounced on a cross from Gnanduillet from the right and directed his header past Dundee keeper to make it 1-0.
The Dark Blues fought to get back level and they nearly did so three minutes before the break when, standing just outside the box, Paul McGowan hit a half-volley that smacked the bar. Danny Mullen nodded the rebound over.
After the restart, Hearts missed a glorious chance to make it 2-0 when they broke in numbers on 53 minutes. Boyce played in Gnanduillet, who then squared to Gary Mackay-Steven right in front of the Dundee goal. It looked like the former Dundee United man couldn’t miss but he did…or at least keeper Hamiltoin saved his weak shot.
Just two minutes later, the Jam Tarts hit the woodwork again when Boyce crashed a shot off the bar from 12 yards.
The pressure was building on McPake’s men and it wasn’t a surprise when it became 2-0 to the hosts on 58 minutes. Mackay-Steven was the provider for Gnanduillet, whose first effort was saved but the rebound hit off him and spun back over Hamilton.
Dundee had to dig deep and they did just that on 63 minutes, thanks to Cummings’ well-taken penalty. Hearts’ Mihai Popescu clearly fouled Max Anderson inside the box and it was an easy decision for referee Don Robertson. Cummings sent the ball to his own right and the goalie’s left to make it 2-1.
With 69 minutes gone, the visitors almost equalised when Cummings’ strike was parried by Hearts goalie Gordon into the path of sub Osman Sow but the big man’s shot was saved at close range.
On 83 minutes, the Dark Blues once again came close to a leveller when Gordon made s superb double-stop to thwart first Sow then fellow sub Jonathan Afolabi.
Hearts sub Peter Haring was sent off in stoppage time for a terrible late challenge on Dundee’s Declan McDaid but the hosts saw the remaining minute out.
Hearts: Gordon, Smith, Gnanduillet (White 75), Boyce, Halliday, Mackay-Steven (Walker 65), McEneff, Irving (Haring 89), Kingsley, Halkett, Popescu. Subs not used: Stewart, Berra, Kastaneer, Henderson.
Dundee: Hamilton, Fontaine, Mullen (Sow 57), McGowan, McDaid, Ashcroft, Elliott, McMullan, Marshall, Anderson (Afolabi 77), Cummings. Subs not used: Legzdins, Fagan-Walcott, Byrne, Robertson.
Referee: Don Robertson.