Hearts matchwinner Paul Hartley proved the difference between the sides when he shot Hearts in front in the first half and then turned provider with a stunning ball to pick out Kevin McKenna for Hearts' decisive third goal.
However, Hearts didn't have it all their own way and had several fine saves to thank Craig Gordon for as he put up the shutters in the first half.
Indeed the young keeper produced an incredibly one-handed reflex save to deny Collin Samuel just a couple of minutes before Hearts grabbed the opener.
Phil Stamp picked out Hartley's forward run and slipped him through the heart of the United defence to prod home from 10 yards.
But Gordon saved Hearts on two occasions from well struck Mark Wilson free-kicks and then just after the interval the keeper clutched a 20-yard volley from Alan Archibald.
But there was nothing Gordon could do when Jim McIntyre sneaked in behind McKenna to fire a stunning angled equaliser.
Hearts got their noses back in front when Wilson turned Mark De Vries' cross into his own net and Hearts saved the best for last when Hartley struck a 50-yard pass on to the head of McKenna, who made no mistake from six yards.
In a frantic finish that saw United throw everything into attack they found Hearts' defence impossible to break down and indeed it was the home side that had the better opportunities to increase their lead.
Full-back Robbie Neilson blasted wide and Andy Kirk, who had earlier come off the bench, wasted a couple of excellent opportunities when he waited to get his shot away.
Heroic defending from Archibald helped keep respectability to the scoreline.