Frazer Wright picked his time to open his account for St Johnstone as he earned his team their first away win of the season.
The former Kilmarnock defender glanced home Liam Craig’s corner on 86 minutes to leave Michael Fraser helpless in the home goal.
It was his 35th match for Steve Lomas’ team and his ninth appearance so far this term. Wright
The away defence were put under severe pressure as they played for over an hour with then men after Rowan Vine was sent off.
St Johnstone boss Steve Lomas was thrilled with the win, adding: "We had a few hairy moments but we also had a chance which might have been over the line and that would have put the game out of sight at 2-0.
"The character of the team can never be called into question but I wouldn't like it to be so difficult. I'll not make my 40th birthday at this rate. It was a great victory."