Jackie McNamara's side recorded their first win in eight games thanks to Nadir Ciftci's 50th-minute decisive header after Kenny McLean's first-half penalty for the visitors had cancelled out Ryan Gauld's earlier opener for the hosts.
It helped end the Tangerines' seven-game winless streak which stretched back to when Danny Lennon's Saints beat them 4-1 back on Boxing Day in the Scottish Premiership.
Saints triumphed the last time the two clubs met in what proved to be a stormy encounter.
And as early as the second minute, Steven Thompson had the first chance of the match when he ran onto a long ball from the back.
Former United striker Thompson took a touch before unleashing a powerful shot from 22-yards which United keeper Radoslaw Cierzniak did well to save.
Two minutes later, the hosts responded when Stuart Armstrong's deflected shot off Darren McGregor was heading for the bottom corner, until Saints keeper Marian Kello pulled off a decent stop.
United were beginning to find their feet and in eight minutes, Gary Mackay-Steven skinned on-loan Newcastle man Conor Newton before cutting the ball back for stand-in skipper Armstrong.
But just as Armstrong looked about to pull the trigger from 10-yards, the midfielder dragged his shot well wide of the target.
The hosts mounted another attack on the quarter-hour mark as Armstrong fed Mackay-Steven who'd overlapped down the left.
Mackay-Steven looked all set to cross the ball into the visitors penalty box, only for McGregor to get back and foil him with a fine sliding challenge.
It was a typically competitive cup tie and Thompson was booked in 17 minutes for a late tackle on John Rankin
Shortly after Eric Djemba-Djemba went in late on Armstrong which had United manager McNamara up in arms on the touchline.
But in 22 minutes United were celebrating as they took the lead.
Ciftci skipped past Djemba-Djemba on the left and cut the ball back for Ryan Gauld.
Gauld had made a surging run into the box and did enough to stab a close-range finish past the helpless Kello.
There was an edge about this televised tie and in 24 minutes United full-back Andrew Robertson was booked for a reckless challenge on Jason Naismith.
But in 26 minutes Saints equalised from the penalty spot.
Midfielder Kenny McLean burst into the box but was brought down by Mark Wilson's trailing leg.
McLean stepped up to make it 1-1 with his low spot-kick which sent Cierzniak the wrong way.
United tried to regain the lead and 10 minutes before half-time Armstrong hit a low effort from distance which went just past the post.
Then, a minute later, Ciftci released Mackay-Steven inside the box and his left-foot shot was well saved by the diving Kello.
Kello came to the rescue again for the visitors just two minutes before the interval.
Armstrong's cross picked out Ciftci whose bullet header was brilliantly saved by Kello to ensure the sides went in level at the break.
Djemba-Djemba was shown a yellow card by referee Craig Thomson at the start of the second-half for a foul on Robertson.
And in 50 minutes Ciftci made it 2-1 to United as he rose unchallenged at the far post to head home Mackay-Steven's deep cross.
Midway through the second-half, United came close to increasing their lead when Rankin passed to Gauld whose shot from 18-yards was tipped over the bar by Kello.
Saints almost levelled in 78 minutes but Cierzniak denied them with a superb save from Thompson's header after substitute Gary Teale had delivered an inch-perfect free-kick.
United held out though towards the end despite Saints' best efforts to equalise to book their place in the last eight of the competition.