A Liam Craig double gave Saints victory and lifted them above Hearts into fourth place in the Premiership.
The former Falkirk and Hibs midfielder headed home Graham Cummins’ cross at the back post after eight minutes.
Then in the second period he sealed victory with a sweet strike after Scott McDonald had levelled.
The Perth men played the second half with substitute keeper Alan Mannus, after Zander Clark picked up a knock towards the end of the first 45.
Motherwell enjoyed a spell of pressure as the match drew to a close and Saints were relieved to see a Ryan Bowman header hit the post and roll across the face of goal rather than into the net.