David Goodwillie scored from the penalty spot at the second attempt after he was fouled by Paul Lawson on the hour mark.
But County scored a dramatic equaliser in the 86th minute when Iain Vigurs fired the ball into the corner of the net from 15 yards.
The tie went into extra-time and an unfortunate deflection off Scott Boyd from a David Robertson cross proved to be the winner for the Clydesdale Bank Premier League side.
Goodwillie got the first effort in on goal after just 30 seconds but the sting was taken out of shot when it deflected off Darren McCormack.
At the other end Garry Wood tried to play Martin Scott in on goal but United goalkeeper Dusan Pernis raced out of his goal to clear the danger.
County forced the first corner of the match in the third minute when a Martin Scott shot was deflected behind.
The home side looked fired up for the tie and Iain Vigurs weaved past a couple of defenders in the box in the ninth minute but his shot was well held by Pernis.
United threatened for the first time when Michael McGovern made a double save from Jon Daly and Goodwillie in quick succession.
But most of the action was at the other end and Richard Brittain and Scott Morrison both hit shots over the top as County continued to dominate.
Gary Miller made a good run down the right flank and his deep cross was cleared as far as Brittain who sliced his shot well wide.
County had United on the ropes and Scott Severin was shown a yellow card for a wild tackle on Miller in the 32nd minute.
Despite all the pressure on the United goal it was the visitors who almost snatched the lead a minute later when Prince Buaben put Goodwillie clear and his snap shot cannoned off the underside of the crossbar before being cleared.
But County should have taken the lead in the next attack when Miller sent over an inch perfect cross for Mark Corcoran but he failed to get enough on his header and Pernis easily gathered.
Goodwillie flashed a shot past McGovern’s left hand post in the opening seconds of the second half as the Premier League side showed their intent.
United came close again in the 52nd minute when Brittain sliced his clearance into the path of Morgaro Gomis whose goalbound shot was booted clear by Miller.
United made the breakthrough on the hour mark when Paul Lawson barged into Goodwillie in the box.
Referee Craig Thomson had no hesitation in pointing to the spot. Goodwillie converted from the spot but was asked to take it again after he staggered his run-up but he made not mistake with his second attempt firing into McGovern’s left hand corner.
County were awarded a free-kick in the 68th minute when David Robertson was booked for a tackle on Scott but Brittain fired his effort well over.
But with just four minutes of regulation time left Morrison threaded the ball to Garry Wood whose flick on fell for Vigurs who whipped a left foot shot into Pernis’ left hand corner from just inside the area.
Then in the 99th minute a Robertson cross into the box was deflected into his own net by Boyd.