The only goal came with eight minutes left when a shot from substitute Ryan Hedges took a touch off defender Liam Gordon and beat keeper Elliot Parish.
It was a game of few chances in Perth, in what was Saints' first home match of the season, and a goalless draw looked likely until Hedges struck.