Kevin Holt secured Dundee derby redemption by setting up United striker Sam Dalby’s late winner after giving away the penalty that earned his former club the opening goal at Dens Park.
Former United striker Simon Murray netted following the VAR-assisted award in the 61st minute after Holt was penalised for handball.
But the visitors were level four minutes later when Croatian midfielder Vicko Sevelj headed home his first United goal following a long throw.
And centre-back Holt raced down the left flank before crossing for Dalby to supply a near-post finish in the 88th minute to seal a 2-1 win.
Dalby’s 10th goal in 13 matches sent Jim Goodwin’s side above Aberdeen into third place in the William Hill Premiership while Dundee drop to ninth.
The 11,585 sell-out crowd got value for money with an enthralling second half as both sides went full out for a winner.
The action started inside the first minute when Dalby had a header clawed away by Trevor Carson.
Dundee had the best chance of the first half when Seb Palmer-Houlden’s cutback set up Finlay Robertson but Ryan Strain cleared the wing-back’s shot off the line and Oluwaseun hit the rebound just wide on the turn.
Robertson twice came close from long range either side of Dalby turning the ball just wide from six yards after a knockdown.
Dundee were dominating possession and Palmer-Houlden turned a shot wide before Jack Walton saved Mo Sylla’s shot at the second attempt.
Strain set up a good chance for United after beating two men on a surging run and setting up Kristijan Trapanovski but the midfielder’s effort just cleared the bar.
United manager Jim Goodwin brought on centre-back Ross Graham for Trapanovski and matched the home side’s 3-5-2 formation for the start of the second half.
Strain had a shot deflected wide but Dundee were soon ahead after referee Steven McLean was called to the monitor by video assistant Gavin Duncan after Murray claimed Holt had handled Palmer-Houlden’s cross.
McLean took his time before pointing to the spot and Murray sent Walton the wrong way.
The opener sparked a flurry of activity and Ross Docherty and Palmer-Houlden threatened at either end before Sevelj nodded home from close range after the Dundee forward had inadvertently set him up with a defensive header that went back the wrong way.
Palmer-Houlden soon had a chance to make amends after being set up by Lyall Cameron but Walton was out quickly to block the shot.
The play was end to end and Carson made a brilliant stop from Strain after the ball broke for the wing-back 10 yards out.
United sealed the win after Holt’s run went untracked and Dalby got ahead of Luke Graham to slot home from close range.