Dundee played second fiddle for much of their game at Dumbarton, but still emerged with a 1-0 win after Peter MacDonald came off the bench to score the decisive goal with just seven minutes left.
The home side had a chance to take a point when they were awarded a penalty, but substitute Bryan Prunty directed his kick straight at Dundee goalkeeper Kyle Letheren.
Dumbarton will regret not taking their chances, when they were on top for much of the first half.
Chris Turner looked to have put them ahead with a header which found the net, but referee Brian Colvin spotted an infringement and quickly chalked it off.
The hosts continued to look the more menacing and it was not until the ineffective Christian Nade was replaced by MacDonald after an hour that the tide turned in Dundee's favour.
Hamilton left it even later to bag their three points as they edged out bottom markers Morton 4-3 at Cappielow with Mickael Antoine-Curier, who had only been on the pitch for five minutes, scoring the winner.
Hamilton were ahead three times - through Jason Scotland and Louis Longridge (2) - only for Kenny Shiels' relegation certainties to fight their way back into the match.
Rowan Vine cancelled out Scotland's early goal before Marc Fitzpatrick and then substitute Garry O'Connor also scored for the home side.
O'Connor looked to have salvaged a point with his 84th-minute goal, but Hamilton dug deep to wrap the points.
Alloa Athletic wounded Falkirk's challenge 3-0 at Recreation Park, their first win at home in seven attempts.
The match was evenly balanced until Phil Roberts was sent off for Falkirk in the 63rd minute and Alloa took full advantage of the numerical edge.
Eddie Ferns outpaced the Falkirk defence to put them ahead and then Kevin Cawley headed a second goal before Ryan McCord completed the scoring with just three minutes left.
Queen of the South saw off Cowdenbeath 2-1 in Dumfries to enhance their play-off hopes.
Queens grabbed the lead when Chris Higgins stole in at the near post to side-foot home after 16 minutes. Gavin Reilly doubled their advantage after 31 minutes when he pounced on a poor header from Dean Brett to round the goalkeeper and score.
Iain Russell should have made it 3-0 just after the break but shot straight at Seb Usai. Sammy Stewart pulled back an injury-time goal for Cowdenbeath, but they could not bridge the deficit.
Livingston won 4-2 at Raith Rovers with Craig Sives and Marc McNulty both scoring doubles.
Sives headed the opening goal early on, but John Baird equalised two minutes into the second half.
McNulty restored Livingston's lead from the penalty spot after he had been fouled by Joe Cardle and Sives added a third soon afterwards.
Greig Spence missed a penalty as Rovers tried to rally. Jason Thomson pulled one back in 85 minutes before McNulty added a fourth for Livingston in stoppage time.