Lionel Ainsworth gave Motherwell the lead early on before Dave MacKay headed Saints level midway through the first half.
Stephen McManus got the decisive goal in controversial circumstances before half-time, his headed effort adjudged to have crossed the line before being punched clear by defender Steven Anderson.
The win sees Motherwell all but secure third place in the standings with just two games to play and also takes them to within a point of second-placed Aberdeen.
Motherwell started the match brightly as the aerial prowess of John Sutton caused problems, and they passed up a couple of decent early openings before James McFadden was presented with a great chance to put the Steelmen ahead after nine minutes.
Great work by Zaine Francis-Angol down the left saw the ball forced back to McFadden on the edge of the area, but with time and space his side-footed effort was tame allowing Alan Mannus to gather.
St Johnstone had a good opportunity minutes later as they won the ball in midfield and released Stevie May on the right wing. The in-form striker ran at the Motherwell defence who backed off allowing him to get a shot away, but his effort was skewed well wide.
Ainsworth then had an effort for the home side, cutting in from the right before unleashing a strike that Mannus could only parry, and with the ball bouncing loose in the six-yard area McKay reacted quickest to get the ball to safety.
Ainsworth did have the beating of Mannus to open the scoring in the 21st minute, although there looked to be a touch of fortune about the winger's looped finish.
Sutton laid the ball back to McFadden on the edge of the box, and his quick feet allowed the forward to skip over a challenge before laying the ball wide to Ainsworth. It looked as though the winger attempted to hang a cross up towards the far post, but it looped over Mannus into the net to give the Englishman his 11th goal of the season.
The lead lasted just five minutes, the visitors getting back on level terms in the simplest fashion.
An inswinging corner from the right by David Wotherspoon was met by the head of MacKay, who nodded home his third goal of the season unchallenged from the middle of the box.
There was a moment of controversy as the Steelmen moved ahead again on 35 minutes. Iain Vigurs' free-kick to the far post found McManus unmarked and his headed effort bounced over Mannus before appearing to be punched off the line by Anderson.
With the whole stadium waiting for referee Kevin Clancy to point to the spot and send the defender off, assistant referee Andrew McWilliam signalled that the ball had crossed the line before Anderson made contact and the goal was awarded.
St Johnstone were the brighter side at the start of the second half and had Motherwell pinned back without creating any clear-cut chances, and their frustration was evident as May attempted to win a penalty by diving over Keith Lasley's planted left leg only to be shown a yellow card for simulation.
The visitors did carve out a decent opportunity after 70 minutes, Wotherspoon dancing his way along the Motherwell 18-yard line before firing a low left-foot effort wide of Lee Hollis's left-hand post.
Motherwell were looking content to sit on their lead and attempt to hit St Johnstone on the break, and the visitors were offering little in the way of a serious threat to the home goal in a largely uneventful second half.
Saints almost hit the equaliser they may have felt they deserved with four minutes remaining, Hollis's punch clear being met on the half-volley on the edge of the area by Gary Miller, but the goalkeeper recovered to make a great stop low to his left to ensure the points stayed in Lanarkshire.