Steve Crawford hit another late winner to give Dunfermline three important points.
It was a typical striker's effort as he took advantage of some slack marking after 73 minutes to blast the ball past Tony Bullock.
Yet the home side were second to every ball in the first half, but the game turned with Darren Young's equaliser within 15 seconds of the restart.
St Mirren grabbed the lead after ten minutes when John Sutton picked up a loose ball at the edge of the area and guided a right-foot shot into the corner of the net.
Dunfermline hit back and Jim Hamilton managed to get his head to an Owen Morrison cross but there was no power in his effort.
St Mirren came close again midway through the first half when Kirk Broadfoot shot a yard wide after a well-worked free-kick.
Dunfermline came out with all guns blazing in the second half. Young hit a stunning equaliser within 15 seconds of the restart after Hamilton had laid the ball into his path.
Crawford then should have done much better after Owen Morrison teed him up but he lashed his shot carelessly wide.
However, he had the final say when Morrison spied him at a throw-in and there was only one outcome.