The Edinburgh side headed into the match at Tynecastle boosted by last weekend's win over Celtic which allowed them to book their place in the Scottish Cup final against city rivals Hibernian.
A goal from Sone Aluko and an Andy Little double sealed the win for administration-hit Rangers, while a penalty miss from cup hero Craig Beattie only added to Hearts' despair.
Scott Robertson scored after 32 minutes and John Rankin in second half stoppage time as United leapfrogged their hosts to move within three points of third-placed Motherwell, who meet Celtic on Sunday, meaning Champions League football is a realistic prospect at Tannadice next term.
Two own goals were enough to send
After a goalless first half, Spanish defender Roman Golobart headed into his own goal 48 seconds after the restart.
Full-back Kenny Gillet doubled the lead with a minute to go when Josh Magennis's shot rebounded off goalkeeper Jonny Tuffey on to the Frenchman and into the net.
Andrew Barrowman headed a late equaliser as
Steven Thompson struck a hat-trick to leave the Pars staring at another defeat midway through the second half but Liam Buchanan's wonderful strike gave Dunfermline hope and substitute Barrowman converted two minutes from time.
The draw leaves bottom club Dunfermline six points behind Hibernian, who host Kilmarnock on Sunday.