An 83rd minute Callum Hendry strike gave Saints a vital three points in the push for a top six finish.
In a tight match which wasn't pleasing on the eye, it needed a moment of quality to turn one point into three with Drey Wright's superbly drilled cross converted by Cal who netted his 9th of the season in all competitions.
The win puts Saints 7th - one point behind Hibs in 6th and just three points behind 5th placed Livi.
Saints went into this afternoon's clash with Livingston in good spirits after a hard fought point in Paisley in midweek.
It kept the top six battle well and truly alive but manager Tommy Wright knew that the Livingston match would go a long way to determining whether his side would still be in the hunt for a top half finish.
And the home side started brightly forcing an early corner through some good play between Jason Holt and Stevie May.
The first opportunity for the visitors would come from a free-kick but former Celtic and Hibs defender Efe Ambrose fired his effort straight at the Saints wall.
Saints would come close again on 17 minutes when a great cross from captain Jason Kerr met the head of Stevie May but his glancing header was saved by Robbie McCrorie.
Livingston came close to an opener seven minutes later, when a rare mistake at the back from Liam Gordon was seized upon by Steven Lawless who fired a fierce volley towards goal which was superbly saved by Zander Clark.
That gave the visitors a lift as they forced a period of pressure through corners and Ciaron Brown's long throw which the Saints defence managed to deal with relatively comfortably.
However, there was a momentary lapse at the back which almost proved costly as Lawless found himself one-on-one with Zander before squeezing his effort just wide of the target.
The sides went in at the break goalless in what had been a pretty scrappy opening 45 minutes.
And the second half started in a similar fashion. Neither side was able to create much in the opening 10 minutes of the second period with the biggest talking point a diving header about 25-yards-out by Zander Clark to deny the on-rushing Lyndon Dykes.
The weather deteriorated on the hour mark with strong winds and driving rain making the already tough conditions even more difficult.
Both managers decided to make changes hoping that it would spark their side into the bit of magic required to take control of the match.
O'Halloran replaced May on 71 minutes with Livingston also making a switch at the same time, Robinson coming on for Craig Sibbald.
Gary Holt made another switch minutes later with Keagan Jacobs entering the action in place of Steven Lawless before making their third and final switch minutes later - Taylor-Sinclair replacing McMillan.
Tommy Wright made another change of his own on 80 minutes with David Wotherspoon replacing Jason Holt as Saints looked to find something to grab a vital three points.
And four minutes later that moment would come.
A lovely ball by Ali McCann over the top to Drey Wright created space and the Saints winger fired a ball in at pace to the box where it was met by Callum Hendry who executed his finish perfectly leaving McCrorie with no chance.
It could have got even better for Saints.
A lovely bit of play by Wotherspoon at the edge of the area created space for a shot but the subsitute saw his goalbound effort excellently tipped over the crossbar by McCrorie.
From there, Saints saw the game out to take a huge three points against a top six rival. It sets up a huge clash at Easter Road next weekend against Hibs for Tommy Wright's men.
SAINTS: Clark, Kerr (c), Gordon, McCart, Wright, Tanser, Butcher, McCann, Holt (Wotherspoon 80), May (O'Halloran 71), Hendry
UNUSED SUBS: Parish, Booth, Kane, Jones, Ralston
SCORER: Hendry (83)
LIVINGSTON: McCrorie, Ambrose, Guthrie, Brown, Devlin, McMillan (Taylor-Sinclair 78), Bartley (c), Pittman, Lawless (Jacobs 74), Sibbald (Robinson 71), Dykes
UNUSED SUBS: Schofield, Souda, Lawson, Crawford
©Copyright 2016 - all rights reserved by St Johnstone Football Club
Registered in Scotland 7629
Unless otherwise stated all photographs on this site are ©Perthshire Picture Agency and may not be used without permission.