The former Blackpool midfielder blasted home following a 74th-minute corner to add to Graham Bayne's impressive header five minutes earlier.
St Mirren had a penalty appeal turned down as Greg Shields challenged Jim Hamilton earlier in an entertaining second half but the Scottish Premier League side looked well beaten in the final stages.
The win offered First Division Dunfermline some measure of payback for their unsuccessful relegation battle with Saints two seasons ago, while Hamilton, Billy Mehmet, John Potter and Gary Mason all endured defeat against their former club.
The top-flight scalp also gave Pars boss Jim McIntyre success over his former Kilmarnock team-mate Gus MacPherson.
Those ingredients had promised to add spice but the first half proved a bland affair.
St Mirren, who were missing key midfielder Andy Dorman, caused problems early on with high balls and Hamilton looped a header on to the roof of the net from Jack Ross' cross.
Dunfermline gained the upper hand for 10 minutes and Steven Bell had a header blocked from Kevin Harper's corner.
St Mirren began to edge possession but they struggled to break the Pars down and long-range efforts by full-backs Ross and Franco Miranda failed to find the target.
Scott Wilson's excellent goalmouth challenge stopped Hamilton converting Miranda's cross before Greg Shields did enforce Mehmet to fire wide from the loose ball.
Bell got another header on target from a Harper set-piece but the ball bounced gently into Mark Howard's arms, before Shields blocked well from McGinn's volley in the dying seconds of the half.
Both sides attacked with more purpose after the restart and the visitors carved out a half-chance when Mehmet laid the ball off for Hamilton to shoot just over from 20 yards.
Howard saved comfortably from Andy Kirk's shot on the turn before setting up a chance for Hamilton, which produced the game's first moment of controversy.
The striker ran on to a long kick-out which sailed straight over the home defence before Shields slid in. The defender appeared to get something on the ball and then brought down Hamilton, with referee Calum Murray waving play on.
Both sides were passing the ball around with pace and Kirk struck the top of the bar from 20 yards following a great piece of skill to turn Ross.
The Pars did net in the 69th minute when Bayne rose 16 yards out to guide a difficult header into the top corner following Harper's cross.
St Mirren tried to hit back and Mehmet glanced a header wide from McGinn's corner, but their hopes drifted away when substitute Wiles lashed the ball in off the bar after Kirk had knocked Harper's corner back across goal.
Buddies substitute Steven Robb volleyed over from 12 yards after running on to Miranda's cross but the visitors rarely threatened a comeback and were subjected to jeers from their supporters.