With Kilmarnock, the current occupants of the play-off position, also victorious, simply maintaining the four-point gap between them was vital for the Lanarkshire club as they head into the split.
“This place should be a hard place to come to and it was for a long time,” said home manager Martin Canning. “We got away from that but we need to get back to that again, especially at this stage of the season.
“It will take performances like this. In the first half we were excellent and controlled the game then, after the break, we had to dig in a little bit.
“If the second half had been the same as the first I’d have expected us to go on and score a few more goals but football isn’t like that.
“But we took three points at home at last and that’s the most pleasing thing for me.”
Hamilton came close to drawing first blood in the tenth minute, when Carlton Morris teed up Greg Docherty, whose full-blooded drive from the edge of the penalty area was turned over by Scott Bain.
Bain denied them again shortly afterwards, stretching every sinew to push a raking shot from Eamonn Brophy behind.
The pressure on the visitors was relentless and Julen Extabeguren was content to take a caution for a cynical foul on Ali Crawford as Accies durged forward.
Dundee finally found a way out of their own half in the 24th minute, when Greg Stewart displayed both an exquisite first touch and vision to set up Kane Hemmings, whose low shot was clawed away by Michael McGovern.
That save assumed greater importance when Accies took the lead half an hour in. Paul Hartley was furious with his rearguard inaction when they did not react to a deep cross but, while his defenders remained static, Docherty touched the ball on for Ali Crawford, who speared a right-foot shot behind Bain from 15 yards.
Dundee’s hopes of a top-six finish were fading fast and a senseless foul by Extaburgen on Brophy left referee John Beaton with a simple decision to award a penalty, which was confidently despatched by Jesus Garcia Tena.
Bain kept them in it, theoretically at least, with a superb reflex save to keep out a close-range header from Crawford on the stroke of half-time.
Craig Wighton failed to appear for the second half, replaced by maverick midfielder Gary Harkins and his introduction invigorated the Dark Blues and their travelling support. He gave his side a foothold in the contest with a superb goal, collecting a return pass from Hemmings before lofting the ball over McGovern.
That provided some hope for manager Hartley but his players were unable to breach their rivals again, although Thomas Konrad wastefully headed a Greg Stewart cross straight at McGovern.
“It’s a massive blow for us,” Hartley admitted. “We had aspirations to be in the top six and we had it in our own hands but we didn’t perform today. In the first half we couldn’t cope with their physicality and we just didn’t turn up. It’s a major disappointment. The dressing room is quiet.
“We set our sights high this season. We wanted to be in the top half and felt we could get in there but it’s probably not just down to this game – we’ve had 14 draws this season and too many of them have come from us being in good positions where we should have won.
“I wouldn’t say [missing out] should set us back in what we’re trying to achieve longer term. But we want to be up there among the best teams and the players have been great for the majority of the season. However, we let ourselves down today.”
Hamilton Academical 2
Crawford 30; Tena 41 pen