Callum Paterson's header rescued a point for Hearts amid a frantic ending at Tynecastle.
St Johnstone substitute Chris Kane looked to have won the match by putting his team 2-1 ahead on 85 minutes, but Paterson produced a defiant response with his sixth goal of the season.
Danny Swanson's equalising goal had the teams level at half-time. Prince Buaben's header put the hosts ahead but Swanson levelled the score before half-time on his return to Tynecastle. The midfielder spent five months with Hearts last season but failed to make an impact and moved to Perth in February this year. He is enjoying a rich vein of form this season and struck his tenth goal in 18 games.
Hearts now have only one win from their last ten meetings with St Johnstone after a very open affair with plenty scoring opportunities. They tried to force the issue in the second half but the well-marshalled visiting defence held firm. When Kane scored, all three points looked destined for McDiarmid Park until Paterson headed the equaliser two minutes later. The result leaves Hearts third in the table, two points behind second-placed Aberdeen.
Liam Smith slotted in at left-back for Hearts after a month's loan at Raith Rovers. Striker Tony Watt and scarcely-seen midfielder Buaben also started, but it was St Johnstone who almost scored in the opening minutes. David Wotherspoon fastened on to Blair Alston's weighted through pass on the left and cut inside Callum Paterson to sting the palms of Hearts goalkeeper Jack Hamilton.
Alston then earned a caution for a late and reckless sliding tackle on Smith near the centre circle. When Steven Anderson challenged Watt inside the visitors' penalty area, there were howls for a penalty from the home support. Referee Don Robertson ignored them. Hamilton made another save from Swanson - making his Tynecastle return - as the better of the early chances were fashioned by Saints.
Hearts gradually imposed themselves on proceedings and forced themselves ahead on 24 minutes. Don Cowie's shot ricocheted off a defender and the ball looped up onto the crossbar. When it bounced out, Buaben was in place three yards out to head it over the line before Brian Easton's last-gasp clearance. St Johnstone players protested that the ball hadn't crossed the line but the standside assistant referee Brian Templeton flagged immediately to award the goal.
The high tempo of the match continued although play was often untidy. Buaben forced the St Johnstone goalkeeper Zander Clark into an impressive save low to his left before play again swung to the opposite end and the Perth side equalised.
For all the scrappy play hitherto, their goal was beautifully constructed. Striker Steven MacLean turned Igor Rossi in the centre circle and delivered a perfect pass through to Swanson. He reached the ball ahead of John Souttar, then turned inside the centre-back and angled a right-footed finish beyond Hamilton from 18 yards. The former Hearts midfielder then made the most of the opportunity to celebrate scoring against his former employers.
There was another important intervention by Hamilton at the start of the second half. He dived low to his left to prevent Wotherspoon's effort creeping in at the far post. The keeper couldn't stop Wotherspoon's free-kick seconds later, but to his good fortune the ball rebounded off the post only to be converted by Joe Shaughnessy from an offside position. The goal was disallowed.
Hearts had two attempts at regaining the lead on 54 minutes and were only denied by two superb blocks. First, Clark pushed Walker's low drive from 20 yards out. Bjorn Johnsen hit the rebound first time, only for Anderson to appear from nowhere and throw his body in front of the shot.
Neither team was adept at keeping the ball in the second half and that led to more poor passages of play. It also meant more long balls at times as the search for a winning goal continued. The Tynecastle pitch was cutting up in places and the bobbly surface certainly wasn't conducive to flowing, passing football.
With five minutes left, St Johnstone delivered what looked like a sucker-punch. Wotherspoon took advantage of Perry Kitchen losing his footing out wide and charged forward. He flicked a low cutback into Kane's path for a first-time finish with the side of his foot.
However, Hearts recovered instantly. From Cowie's corner, Paterson's downward header bounced up and into the net to rescue a point for the Edinburgh club.
Hearts (4-4-2): Hamilton; Paterson, Souttar, Rossi, L Smith; Walker, Cowie, Kitchen, Buaben; Johnsen, Watt.
62: Djoum for Buaben
77: Muirhead for Watt
83: Sammon for Johnsen
Unused subs: Noring, Rherras, Ozturk, Currie.
St Johnstone (4-4-1-1): Clark; Foster, Anderson, Shaughnessy, Easton; Alston, Millar, Paton, Millar, Wotherspoon; Swanson; MacLean.
26: Craig for Millar
81: Kane for Swanson
Unused subs: Mannus, Scobbie, Coulson, Gordon, Cummins.
Referee: Don Robertson.