Kevin Holt scored the game’s only goal but Elliott Parish was Dundee’s hero, saving a late Dougie Imrie penalty to all but confirm Premiership safety.
Neil McCann’s side took the lead on 18 minutes with their first clear-cut chance of the game.
Excelling on his comeback trail, Craig Wighton left Accies full-back Shaun Want wanting as he delivered a low cross into the box from the left.
Holt paused to gather the ball from behind him, which sat up nicely, and unleashed a stinging left-foot volley beyond Gary Woods in the Hamilton goal.
The Dark Blues dominated the rest of the first-half with Simon Murray and Steven Caulker both going close with headers.
Just before the half-time whistle, captain for the day Paul McGowan picked up a bouncing loose ball from 30 yards and sent a dipping volley dangerously towards Woods but the goalie did well to gather.
Lewis Spence replaced Mark O’Hara at the break, who lost his two front teeth after a collision with Danny Redmond on 10 minutes, and showed up well in the middle of the park.
The Dee picked up where they left off in the opening period, completely controlling the second 45.
Wighton continued to pose the biggest danger for the home side, jinking down the left past his new marker Darren Lyon on several occasions.
His best effort came on 53 minutes, cutting inside onto his favoured right to send a raking drive in for sub keeper Ryan Fulton to save.
The game became scrappy with both teams picking up yellow cards left, right and centre before Cammy Kerr sprung into life on a surging run down the right on 65 minutes.
Murray did well to hold up the ball before slipping in his fellow Dundonian who fell at the final hurdle with the goal gaping.
After a back and forth period, the worst happened on 85 minutes when 19-year-old substitute Daniel Jefferies, making his debut, fouled Marios Ogkmpoe in the box.
Referee Steven McLean pointed to the spot and Dougie Imrie stepped up to take.
However, his penalty was saved by Dee keeper Elliott Parish.
Dundee held on to all but confirm Premiership survival. The Dee are six points ahead of Partick Thistle in the relegation play-off spot and, crucially, cannot drop down automatically.
Dundee (4-2-3-1): Parish (GK); Kerr, Holt, Caulker, O’Dea; Kamara, O’Hara (Spence 45); McGowan (C); Deacon (Jefferies 74), Wighton (Scott 90); Murray.
Subs: Ferrie (GK), Jefferies, Leitch-Smith, Aurtenetxe, Wolters, Spence, Scott.
Hamilton (3-5-2): Woods (GK) (Fulton 45); Want, Tomas, Van der Weg; MacKinnon, Jenkins, Lyon, Redmond (Rojano 66), Imrie (C); Bingham (McMann 78), Ogkmpoe.
Subs: Fulton (GK), McMann, Scott, Rojano, Hughes, Cunningham, Breen.
Ref: Steven McLean.
MOTM: Elliott Parish.