The home team had conceded 10 goals in losing their three previous Scottish Premier League games, but looked more resolute against Hearts.
They could not hold out for even a point however as the visitors followed up on their midweek success over Celtic with Kevin Kyle's 65th-minute penalty and Ryan Stevenson's late clincher.
The Perth club were without defender Dave Mackay with a thigh problem. Jamie Adams was recalled from a loan period at Dundee yesterday and he secured clearance from league officials to start for Saints.
Hearts were without Suso Santana, who learned this week he requires knee surgery.
Kyle required early touchline treatment on a cut nose after an apparent collision with Michael Duberry, but the Hearts forward was able to continue after a short delay.
Kyle did force the first save of the contest, though it was an easy one for Peter Enckelman, as the striker was unable to put enough power onto his headed effort from Ian Black's cross.
Collin Samuel claimed a foul against Adrian Mrowiec as he tried to reach a ball over the top, but despite the Hearts defender seemingly pulling him back and denying a potential goalscoring opportunity, nothing was given by referee Mike Tumilty.
Samuel had nobody to blame but himself moments later as he swung wildly at a shooting chance set up by Duberry's muscular play inside the area, firing the ball badly wide.
Hearts were the more enterprising side early on and Stephen Elliott should have done better with an angled drive blazed over the crossbar with an unmarked Kyle wanting a pass in the middle.
St Johnstone were presented with a real chance in the 28th minute when Duberry's ball was only half-cleared by Ruben Palazuelos with his goalkeeper Marian Kello drawn out of position behind him, but Liam Craig volleyed wide of the empty net.
David Templeton, so impressive in recent weeks, was at it again here, drifting beyond three St Johnstone players before producing a strike that full-back Alan Maybury did well to block.
Eggert Jonsson's fine run and cross set up midfielder Rudi Skacel in the 43rd minute but his low effort was well held by Enckelman to preserve the deadlock.
St Johnstone made a change at the break, Peter MacDonald on for Craig, and he headed wide a Cleveland Taylor cross.
Jody Morris got the game's first booking for dissent in protest at Adams being penalised for fouling Black.
Hearts were then awarded a 64th-minute penalty for handball, seemingly against Adams, from a Templeton free-kick and went ahead via Kyle's emphatic finish.
Hearts almost doubled their lead in the 68th minute when Skacel set up Elliott for a fierce strike which was pushed wide by Enckelman.
St Johnstone introduced Sam Parkin for Samuel and he was soon involved, forcing a fine save from Kello after MacDonald's pass.
St Johnstone kept battling to rescue at least a point, but it was Hearts who came closest late on with a Kyle header wide.
And in the final minute of injury time, Elliott's searching pass found substitute Stevenson, who finished well with a low drive.