Paul Hartley grabbed a sensational late winner for Hearts after a five-goal thriller at Tynecastle.
United's Barry Robson (centre) celebrates his strike
Barry Robson's deflected free-kick from 22-yards out gave United the lead after 19 minutes.
Stephen Pressley volleyed in the equaliser from a corner just before the interval, with debutant Lee Miller giving Hearts the lead after the break.
Alan Archibald levelled moments later from 20-yards out but Hartley had the final say with a deflected free-kick.
John Robertson's side assumed control from the first whistle.
Kevin McKenna got a far-post header in on goal from a Joe Hamill cross after four minutes but United keeper Tony Bullock saved comfortably.
Moments later Stevie Crawford, making his United debut, should have opened his account.
Grant Brebner robbed Phil Stamp in the midfield area to leave the Scotland international clean through.
However, the former Millwall striker blasted his 16-yard shot straight at Hearts keeper Craig Gordon and the ball was eventually cleared to safety as the Jambos' defence
Then, in the 19th minute, the visitors took the lead out of the blue with a deflected free-kick from midfielder Barry Robson.
After Derek McInnes had been pushed in the back by Hartley 25 yards from goal, Robson stepped up to thunder a left-footed shot towards goal.
The strike took a touch off the Hearts wall and arced over Gordon and into the top corner.
The Edinburgh side battled to regain their grip on the game, but their fans began to lose patience as United calmly held firm in defence.
In the 32nd minute, McKenna had a decent chance when he latched onto a Pereira lob into the penalty area, but he was off balance and knocked his volley past Bullock's left-hand post.
The home side were back on level terms after 44 minutes.
Stamp swung a corner over from the right which the United keeper came out and missed completely and Jambos' skipper Steven Pressley was at the back post to volley into the empty goal from close range.
Hearts' new striker Miller came on to make his debut after the interval.
The Jambos head coach's bravado worked almost immediately in the 48th minute when the former Falkirk player grabbed his first goal in maroon to give the home side the lead.
The match looked as if it had swung towards the Edinburgh side, who suddenly were playing with a new-found confidence.
But in the 53rd minute, the visitors equalised with a tremendous Archibald free-kick from around 25 yards after Gorgie full-back Robbie Neilson had been penalised for high feet.
As the Hearts defensive wall braced themselves, Mark Wilson rolled the ball across to the former Partick defender who unleashed an unstoppable drive past the flailing Craig Gordon.
The three points were again up for grabs as play raced from end to end.
Pereira might have done better in the 64th minute than blasting his right-footed shot over the bar from 16 yards after skillfully turning inside Wilson.
The home side dominated the latter stages of the game and got the goal their
pressure deserved in the 86th minute after United defender Paul Ritchie fouled Dennis Wyness.
Paul Hartley hammered a 25-yard free-kick past Bullock with the aid of a
deflection to give the home side a welcome victory.
Hearts: Gordon, Neilson, Pressley, Webster, McAllister, Stamp,
MacFarlane (Simmons 76), Hartley, Hamill (Miller 45),
McKenna (Wyness 62), Pereira.
Subs Not Used: Moilanen, Weir, Berra, Wallace.
Goals: Pressley 44, Miller 49, Hartley 86.
Dundee Utd: Bullock, Wilson, Archibald, Ritchie, McCracken,
Kerr, McInnes, Brebner (Mair 65), Robson,
Crawford (Scotland 84), McIntyre.
Subs Not Used: Jarvie, Dodds, Grady, Robertson, Kenneth.
Booked: Robson, McInnes.
Goals: Robson 19, Archibald 53.
Ref: M Ritchie