Conor Newton grabbed the opener on 79 minutes after Gregg Wylde had set him up and substitute Wylde then put the result beyond doubt two minutes from time.
It could have been different had Kilmarnock striker Kris Boyd's shot not come back off the post in between the two goals and Danny Lennon's side took full advantage.
The Buddies had slightly the better chances of a poor first half, with Josh Magennis seeing a shot deflected just wide, while Kenny McLean went close with a 35-yard free-kick.
Paul McGowan went even closer for the home side after the restart when he got the better of Lee Ashcroft only for Killie keeper Craig Samson to make the save.
Kilmarnock slowly began to work their way into the game and home stopper Marian Kello was forced into action as he pushed substitute Robbie Muirhead's curling effort to safety.
McGowan's final contribution before being replaced by Wylde was to send a first-time shot over the bar before his team-mate took centre stage.
Wylde came in from the left flank and played the ball across the 18-yard line and, after Steven Thompson failed to connect with the ball, Newton directed his effort just inside the near post.
Kilmarnock almost drew level just two minutes later but, after latching onto Craig Slater's through ball, Boyd was denied by the post after slipping the ball past the onrushing Kello.
That miss was to prove crucial as Wylde doubled the lead in dramatic style to secure the points.
The former Rangers and Aberdeen winger intercepted the ball midway inside his opponents' half before advancing on goal and firing home a powerful 20-yard shot via the post.