The best chance of a dull first half came late on for the hosts when Gary Harkins blazed his volley over the crossbar from 10 yards.
Sam Morrow came within inches of giving County the lead in the second half as his effort on the angle came back off the post.
However, the visitors finally got themselves in front with 80 minutes on the clock through Paul Lawson's controversial strike.
The midfielder's effort hit the underside of the crossbar before bouncing on the line and out, but the goal was given thanks to the linesman.
County secured the three points with the last kick of the game as Garry Glenn slotted the ball into an empty net having beaten the onrushing Dundee goalkeeper Robert Douglas.