Saints knew a 3-0 defeat by Accies and a 1-0 win for Falkirk at Inverness would see the Buddies relegated to the Scottish First Division.
And there was some concern when Accies defender Simon Mensing headed the Lanarkshire side into the lead in the 28th minute from a Brian Easton corner.
That concern intensified in the second half when news emerged that the Bairns had taken the lead at Caley.
However, there was no more scoring in a fractious second half at St Mirren leaving the relieved Paisley side to stay in the SPL ahead of Inverness on goal difference.
Gus MacPherson's men could not afford to relax going into the game but they were also looking for their first SPL win at their new ground since moving in at the end of January.
Driving rain and a swirling wind welcomed the sides for this lunchtime kick-off and, perhaps not surprisingly, the early stages revealed the home side to be the hungrier.
In the third minute, midfielder Andy Dorman flighted in a free-kick from 35 yards which evaded the Accies defence and also team-mate Will Haining, who threw himself unsuccessfully at the ball at the far post.
There was no more goalmouth action of note, however, until the 10th minute when Saints midfielder Garry Brady left Mensing in his slipstream down the left flank before flighting in a cross which just evaded the bar.
As St Mirren continued to have the edge, left-back David Barron had an effort from distance fly over the bar while Dorman sent a 25-yard drive wide of Sean Murdoch's left-hand post.
Accies began to emerge as more of an attacking threat, moving forward through midfielders James McArthur and James McCarthy, but still neither keeper was called into serious action.
But in the 28th minute, the match took on a new significance when the visitors went ahead from their first corner of the game.
When Easton's wind-assisted cross from the right came in at the edge of the six-yard box, Mensing flicked his head and the ball sped past a pile of bodies to land in the back of the net.
St Mirren kicked and scratched to make some headway and three minutes before the break, Brady took a pass from Dorman at the edge of the box but his right-footed shot curled just past the post.
Moments later, Brady again had an effort, this time from 12 yards but he swung wildly at Billy Mehmet's knock-down and the ball flew high and wide.
Within 12 seconds of the second half beginning, Accies striker Joel Thomas clashed with Mark Howard in pursuit of a through ball, and worryingly for the home fans, the St Mirren keeper hobbled around after being awarded the free-kick.
There was no immediate response from the Paisley side.
Hamilton, relaxed and confident, were easier on the eye than the Saints and with some composure on the counter, they may have been able to stretch their lead.
The Buddies, stricken by tension, were reduced to bludgeoning their way forward but to no avail, although in the 57th minute Accies defender Mark McLaughlin did well to block yet another shot on goal from Brady.
Gradually, however, Accies were pushed back towards their penalty area but Murdoch remained well protected.
News that Falkirk had taken the lead at Inverness to leave Saints within two goals of relegation swept St Mirren Park and seconds later, Howard had a point-blank save from Thomas.
But the home side rallied and in the 71st minute Mehmet was at the back post to receive a searching cross from Dorman but his volley was tipped over the bar by Murdoch.
Accies survived the corner and were not bothered again until the 84th minute when substitute Stephen O'Donnell, on seconds earlier for Brady, fired an angled shot just over the bar from 14 yards.
Both sides looked happy enough to see out the final minutes and the game fizzled out to leave the last-day heartbreak to Caley fans in Inverness.