A Jon Daly penalty and Stuart Armstrong strike cancelled out Paul Dummett's opener to give United a 2-1 half-time lead which evaporated when Steven Thompson netted his fourth goal in three games after 50 minutes.
Marc McAusland put the Buddies in front after 65 minutes before United defender Brian McLean was sent off and a rare David van Zanten goal after 78 minutes completed victory for the visitors.
Barry Douglas' 90th-minute free-kick was mere consolation as United's winless run at Tannadice was extended to 10 games.
Hegarty said: "Scoring three goals and coming away with nothing is disappointing.
"The goals we lost were poor by our standards and it told in the end because we lost the three points.
"We've had too many games like that at home this year. We can't explain it."
Willo Flood went off midway through the first half with a groin problem and McLean's dismissal means a reshuffle will be required on Wednesday at Aberdeen.
Unless Sean Dillon recovers sooner than expected from a thigh injury, striker Daly is likely to drop back to centre-back.
Hegarty added: "He's a quality striker and we'd rather have him up front, but we had to put Jon back (after McLean's dismissal)."