Paul Hartley got the performance and result he was badly needing, as Dundee’s six-game losing run and 10-game winless run finally came to an end.
A Paul McGowan second half shot, that might have been helped on its way by Marcus Haber, found the bottom corner of the net and relieved the pressure building on the Dens Park boss.
The result closes the gap to second bottom in the Premiership (Ross County) to just one point.
Hartley would have been looking for a positive start but he very nearly got the exact opposite.
A mere 20 seconds were on the clock when his defenders were caught flat-footed by a ball played into their box and Ali Crawford had time and space to pick his spot but blazed over the bar.
There was a decent Dundee response though and a Julen Extabeguren header from a Tom Hateley corner just missed the target on five minutes.
There was an even better chance on 19 minutes when Craig Wighton was allowed to run unchallenged from virtually the half-way line but he dragged his shot past Gary Woods’ right hand post.
Accies had been pretty poor as an attacking force up to this point but David Mitchell, in goal in place of the injured Scott Bain, couldn’t get near to an Alex D’Acol 25-yarder that was inches away from his top corner.
New signing Marcus Haber doesn’t look fully match fit yet and had he been the Canadian may have got more than a toe to a Wighton cross from the left and found the net rather than see his effort drift wide.
Eight minutes after the re-start the game got its first save from either keeper when Mitchell kept out a long range strike from Greg Docherty.
The game was getting a bit scrappy and the goal that broke the deadlock was no masterpiece but nobody in blue was complaining.
McGowan’s shot just after the hour mark went through a crowded box and may have got a touch off Haber. Either way, Woods couldn’t keep it out and Dundee had something to hang on to.
On 82 minutes Haber nearly made it 2-0 when his low angled shot was brilliantly saved at full stretch by Woods.
There was a late scare when Danny Redmond tried to work space for himself in the Dundee box but he delayed too long and his effort was charged down.
And that was as good as it got for the hosts who couldn’t deny Dundee their precious and thoroughly deserved win.