Sean Clare's early goal earned Hearts three points at Dens Park to help their quest for a Europa League qualifying place.
The English midfielder poked home the only goal of the afternoon on 13 minutes to end a four-game winless run for the Edinburgh club. The result took them level on points with fourth-placed Kilmarnock, who face St Mirren on Monday night.
Hearts had to fight and scratch for the victory on Tayside and Dundee might feel slightly aggrieved getting nothing from the match. They met a resilient visiting defence who coped well under pressure at various stages of the match. That was a major factor in the final result.
This wasn't a pretty affair but relegation-threatened Dundee gave a good account of themselves. The first half in particular saw them get in behind their opponents several times, although their crosses were met and cleared on most occasions. Hearts clearly didn't travel to Tayside planning to concede at any point.
David Vanecek and Uche Ikpeazu started in attack together for the first time as the Tynecastle side opted for an imposing forward line. Vanecek's previous start was ironically against Dundee in January, when he was substituted after 34 minutes and his performance branded “rubbish” by manager Craig Levein.
The Czech therefore had much to prove after arriving unfit from FK Teplice in January. Dundee had the game's first opportunity when Andy Dales' shot from Kenny Miller's cross was deflected over by Ben Garuccio's challenge. Christophe Berra then blocked Scott Wright's attempt from another cutback as the hosts enjoyed some early attacks.
Hearts recovered to take the lead on 13 minutes. Arnaud Djoum's cross from the left was flicked on by Clare towards Ikpeazu. With defenders Darren O'Dea and Nathan Ralph in attendance, a scramble for possession ensued around six yards out. The ball eventually broke free and Clare settled the issue by prodding it into the net beyond the Dundee goalkeeper Seny Dieng.
Callumn Morrison, recalled to the visitors' team, stung Dieng's palms with a powerful drive from 18 yards moments later. The better of the first half belonged to those in dark blue, though. Miller, Dales and Scott Wright frequently ran in behind the visiting defence but their deliveries into the danger area did not yield an equaliser.
Ikpeazu's physique troubled the Dundee defence, where former Hearts player Ryan McGowan and his colleague O'Dea tried to match the giant Englishman. The opening exchanges in the second half were largely untidy and turgid. Hearts defended resolutely when required and Dundee introduced John O'Sullivan for Dales plus Paul McGowan for Craig Curran looking for some freshness.
The former Dundee striker Craig Wighton replaced Vanecek for Hearts before Dieng saved an Ikpeazu shot low to his right. Rain was now pouring down inside Dens Park, assisted by a swirling wind, making flowing passing moves even more difficult for those on the field.
Hearts weren't looking unduly fazed defending a 1-0 lead into the final 15 minutes. They were retreating all the time and consequently came under pressure. Goalkeeper Bobby Zlamal produced a vital fingertip save to divert Miller's header behind for a corner. Following the set-piece, Zlamal showed excellent reactions high to his left to stop James Horsfield's effort from distance.
Four minutes of stoppage time ended with the final whistle and a huge victory for Hearts to take into Tuesday's Scottish Cup quarter-final replay at home to Partick Thistle.
Dundee (4-4-2): Dieng; Horsfield, R McGowan, O'Dea, Ralph; Dales (O'Sullivan 63), Woods, Robson, Wright (J Curran 73); C Curran (P McGowan 65), Miller. Unused subs: Parish, Kerr, Kusunga, Hadenius.
Hearts (4-4-2): Zlamal; Godinho, Souttar, Berra, Garuccio; Morrison (Dikamona 84), Clare (Bozanic 86), Haring, Djoum; Ikpeazu, Vanecek (Wighton 67). Unused subs: Doyle, Lee, Mulraney, Hickey.
Referee: Nick Walsh.