The visitors opened the scoring through John Sutton, and Andrew Driver gave them a 2-1 half-time advantage after Rowan Vine had levelled the scores.
Steve MacLean equalised after the break in a match filled with goalscoring opportunities and questionable defending.
Hearts were rewarded for their quick start, taking the lead in the 14th minute. Driver's floated free-kick found Sutton who headed down and past Alan Mannus from the left side of the six-yard box.
The lead, however, was short-lived. Two minutes later both Kevin McHattie and Marius Zaliukas failed to make proper connection with a cross from the right. The latter's attempted swipe resulted in the ball being hooked straight up into the air and onto the toe of Vine to tap home from two yards out.
Hearts should have answered four minutes after conceding their advantage but Gordon Smith floated the ball over the crossbar under pressure from David McCracken.
It was a good chance but not as clear-cut as the opportunity Peter Pawlett squandered on 27 minutes. The winger broke through the offside trap to run onto Vine's reverse through ball with only Jamie McDonald to beat but the Hearts keeper did well in parrying the shot.
Difficulty in dealing with routine balls into the box hurt St Johnstone again in the 38th minute. This time it was Ryan McGowan's long throw from the left that found Sutton's head in the penalty area where the goalscorer turned provider by flicking on for Driver to sweep home.
The lead should have been made comfortable five minutes after the restart. Driver's cross from the left was headed back by Sutton who found his strike partner alone in the centre of the penalty area but Smith elected to shoot first time and drove his volley wide of the post.
And it was all square again when Callum Davidson's switched long ball hit Murray Davidson perfectly in stride on the right wing. The midfielder, streaking into the box, rolled the ball across goal for MacLean to tap in.