Craig Thomson converted a 26th-minute penalty after referee Willie Collum adjudged Steven Saunders to have fouled Ryan Stevenson as the ball came over from a Rudi Skacel corner.
Skacel netted a second after 36 minutes and Stevenson headed in a third after 53 minutes to put Hearts - with Marian Kello back in goal - on course for a comfortable win.
But two minutes after Stevenson's effort, John Sutton headed in a Steve Jones cross and after 60 minutes the striker appeared to get a faint touch on Tom Hateley's free-kick.
Sutton, who has been linked with a free transfer move to Hearts this summer, then headed in an 88th-minute equaliser as Scottish Cup finalists Well completed their comeback.
Having once held a 15-point advantage in the race for third, Hearts now hold a seven-point lead over fourth-placed Dundee United, who beat Kilmarnock 4-2.