Hearts won for only the third time in 15 meetings with St Johnstone courtesy of David Milinkovic's strike 39 seconds into the second half.
The Perth club saw midfielder David Wotherspoon red carded on 63 minutes and had to try to force an equaliser with ten men. Hearts held out for victory but would have been mindful that they could have been two or perhaps three goals behind at the break.
St Johnstone controlled the first half, missing two good chances and hitting the crossbar through striker Chris Kane. The Tynecastle goalkeeper Jon McLaughlin was in inspired form throughout the afternoon and was rewarded with yet another clean sheet. The visitors will wonder how they didn't leave Edinburgh with at least a point.
Having suffered their first defeat in 13 games in midweek at Celtic Park, Hearts were eager to recapture winning form quickly. They were without the experienced Don Cowie due to a hamstring problem against a St Johnstone team with only one win in their last six league games. That came at Ibrox in December.
Joaquim Adao debuted in maroon after arriving on loan from the Swiss club FC Sion. He would have wanted to stamp his authority early on but it was Saints who seized control of the initial exchanges.
Wotherspoon's swerving seventh-minute free-kick was pushed to safety by McLaughlin. Another threat moments later saw McLaughlin emerge for a one-on-one and save inadvertently with his head to deny Kane after the striker fastened on to a long ball. The keeper's third vital intervention inside the opening 20 minutes saw him dive left to expertly push away Scott Tanser's netbound low drive.
Hearts' first meaningful effort on target came via Milinkovic on 25 minutes, which the St Johnstone goalkeeper Alan Mannus saved comfortably. That didn't change the flow of play much as the Perth side continued dominating. Kane came even closer to scoring on 31 minutes when his right-footed hooked volley from Matthew Willock's cross thundered off the crossbar.
Adao created Hearts' best opening of the first period with a long loping pass in behind the opposition defence ten minutes from the break. Kyle Lafferty chested it down but his quick-fire shot didn't seriously trouble Mannus. The visitors then appealed strongly for a penalty when Steven Anderson's header ricocheted off Christophe Berra's arm inside the box.
At half-time, no-one in maroon could have complained had St Johnstone been 3-0 ahead. Their dominance was undeniable at that point and, typically, they were made to rue their profligacy in front of goal. Just 39 seconds after the restart, Hearts moved ahead.
Danny Amankwaa's cross from the left found Milinkovic near the six-yard line, the Frenchman managing to hold off Tanser and turn before dispatching a low shot into the net. That settled the home side down somewhat. Their cause was helped further when Wotherspoon was dismissed on 63 minutes.
The former Hibs midfielder was cautioned for persistent fouling only moments earlier when he put in a late challenge on Adao. A second yellow card preceded red and he headed up the tunnel, leaving only ten of his team-mates to fight for an equaliser.
It would have arrived on 69 minutes, but again McLaughlin was the barrier. He sprung to his right to push away substitute Blair Alston's powerful right-footed drive. The numerical disadvantage hindered Saints as they tried to restore parity, whilst Hearts went seeking a second goal to kill the contest.
Alston dipped a St Johnstone free-kick from the left in at the back post which McLaughlin was equal to, while two attempts by Lafferty were off target at the opposite end entering the closing stages. This game was wide open and Lafferty should have hit the target from Milinkovic's clever cutback in the 87th minute.
Hearts looked nervous in defence on a couple of occasions and McLaughlin was again required to hold an effort by Richard Foster. However, they did enough to see the game out for three points.
Hearts (4-1-4-1): McLaughlin; Randall (M Smith 46), Souttar, Berra, Mitchell; Adao (Buaben 65); Amankwaa (McDonald 72), Naismith, Djoum, Milinkovic; Lafferty.
Unused subs: Hamilton, Hughes, Irving, Henderson.
St Johnstone (3-5-2): Mannus; Shaughnessy, Anderson (Alston 66), Kerr; Foster, Wotherspoon, Davidson, Willock (Craig 74), Tanser; Kane, Johnstone (MacLean 77).
Unused subs: Hurst, McClean, Scougall, Watson.
Referee: Andrew Dallas.