The Dons were profligate in the first half, with McGinn twice denied by Alan Mannus, before the Northern Irishman scored from a free-kick after 63 minutes.
McGinn's 11th of the season followed after 81 minutes as Aberdeen defied incessant horizontal rain to end a three-match winless run in the Clydesdale Bank Premier League and climb to fourth, above Saints, who are without a win in four.
Aberdeen, already ravaged by injury, were further depleted by the absences of suspended goalkeeper Jamie Langfield, injured forward Jonny Hayes and ill defender Andrew Considine.
Jason Brown made his first start of the season following Langfield's sending-off in the 2-0 loss to Kilmarnock, captain Russell Anderson returned in defence and Mitchel Megginson also came into the side.
The hosts were seeking a third home SPL win of the season and first since beating Dundee on October 27.
Aberdeen made a strong start as Saints, with Dave MacKay, Steven Anderson, Chris Millar and Frazer Wright returning following the 2-2 draw with Hearts, played towards the worst of the elements.
Mannus saved a 25-yard shot from McGinn which swerved in the wind and then scrambled away the follow-up from Josh Magennis before the ball broke for Megginson, whose effort deflected wide.
Mannus again saved from McGinn after the forward returned to his feet quickly following a good tackle by Wright as he shaped to shoot.
Rory Fallon was unable to control a cross from Clark Robertson and McGinn then shot off balance as Aberdeen pushed forward once more.
The Dons seemed certain to score when Megginson whipped the ball towards the far post, with Fallon unmarked and poised to nod it in, but Anderson hurled himself at the ball and headed wide as he finished up in the net.
Saints replaced Millar with Paddy Cregg in midfield after 28 minutes and six minutes later the visitors had an opportunity when Mackay's cross found Wright, who could not keep the ball down with the goal gaping.
Saints were again indebted to Mannus when he made a point-blank save from McGinn after meeting Magennis' cross from the left.
Magennis and Fallon had tame efforts as Saints were relieved to see the half end goalless.
With prevailing conditions, Saints enjoyed a more attacking threat early in the second half, but soon the hosts' quality showed.
Again it was McGinn with the opportunity, his shot flashing across the face of goal.
Liam Craig shot over for Saints after Anderson halted a run by Rowan Vine before Magennis won a free-kick at the other end in a dangerous position.
From 25 yards out on the right, McGinn kept the ball low as he bent it around the wall into the bottom corner for his 10th of the season.
The Dons were determined to build on the advantage and Mannus saved from McGinn as he shot left-footed across goal and substitute Jamie Masson was denied soon after.
The Dons twice came close to doubling their lead in swift succession, only for Mannus to deny them on each occasion.
McGinn nodded down Masson's cross for Magennis, who had the Saints goalkeeper at full stretch, before McGinn turned the ball goalwards and Mannus saved again.
Saints introduced Nigel Hasselbaink alongside fellow substitute Gregory Tade up front in an effort to find the equaliser, but immediately fell two behind.
Masson threaded the ball from the left through for McGinn to race through and place the ball low beyond Mannus and complete victory.
- Sports & Recreation
- Alan Mannus