Gareth Wardlaw's strike after 65 minutes coupled with Hamilton's 1-0 defeat to St Johnstone means the Buddies will still be playing top-flight football next term.
St Mirren had gone five games without a win prior to this victory but held on for a precious three points against a youthful Aberdeen.
Aberdeen were without Zander Diamond after he picked up a hip injury in the 2-0 defeat to St Johnstone.
The defender was replaced by Clark Robertson, while Michael Paton and Jack Grimmer were both handed starts at the expense of Josh Magennis and Nick Blackman.
The Buddies made three changes from the team that lost 1-0 to Inverness Caledonian Thistle with Marc McAusland, Kenny McLean and Craig Dargo all dropping out.
Slovenian defender Jure Travner returned from suspension, with skipper John Potter and forward Gareth Wardlaw both recalled.
Both teams made a tentative start to the match, with goalmouth action at a premium in the opening stages.
The visitors opted for the direct approach with right-back David Barron sending two searching balls into the Aberdeen penalty with the first well collected by Jamie Langfield and the second powerfully headed clear by Nikola Vujadinovic.
Lee Mair, playing against his former club, was next to threaten for St Mirren but he was unable to generate any power in his header from a Travner free kick.
It took Aberdeen 28 minutes to create their first real chance when Steven Smith won a corner from Potter but Rob Milsom's out-swinging delivery was headed clear by Darren McGregor, much to the frustration of the home support.
The Buddies continued to look the more likely and Paul McGowan was unlucky to see his well-struck volley headed to safety by Ryan Jack.
Paton managed to create a yard of space for himself after 36 minutes but his long-range effort drifted harmlessly wide of the target.
Jack almost fashioned a chance for himself on the stroke of half time when he weaved past two defenders but his shot was blocked by the sliding Steven Thomson.
Wardlaw picked up the first booking of the match within three minutes of the restart for a foul on Vujadinovic, which resulted in the defender requiring treatment for a facial injury.
Chris Maguire, who had been enjoying a quiet game, sent a tantalising ball across goal after 55 minutes but Jack and Paton were unable to apply the finishing touch.
The Buddies finally broke the deadlock after 65 minutes when McGowan's corner was headed into the path of Wardlaw by McGregor and although the striker failed to properly connect with his volleyed shot the ball squirmed under Langfield and into the back of the net.
The introduction of Fraser Fyvie and Josh Magennis for Jack and Paton gave the Dons some fresh impetus and they almost restored parity in spectacular fashion when Maguire's volley flashed past the target.
Fyvie, who returned from a cruciate ligament injury at the weekend, could have levelled after Paul Gallacher had flapped at a cross into the area but the midfielder was unable to find the target with his snap-shot.
Aberdeen continued to probe for an equaliser until the final whistle but were unable to prevent their last home match of the season ending in defeat.