Francis Dickoh's 87th minute header proved to be the difference as Colin Calderwood's men gave a sigh of relief in notching up their third win on the trot.
Calderwood said it was a fantastic result for his side ahead of their home clash with Inverness Caledonian Thistle on the weekend.
"It's decisive in the short term that we've taken six off St Mirren and got ourselves ahead of them," he said.
"It's a big lift for us because if it had gone the other way, the situation would have been a crisis point.
"It was a gritty performance, there was nothing that really flowed. But they dug in and they were still in the game last four minutes, we got a set play and we scored from it.
"The result wasn't based tactically and technically, it was based on a determination to grind it out and keep challenging, and our organisation lasted through more or less through the 90 minutes, but there are lots of aspects we must be better on."