Barker, playing through the pain barrier with broken bone in his foot, scored three goals in two games against the Dragons last season - and his double sent Wrexham spinning to their eighth defeat in nine outings.
The visitors forced home keeper Carl Muggleton into one save all afternoon - and his reflex save in first half injury time probably proved the turning point.
The Welshmen, beaten in their last four away trips and with just one win in eight games, gave a debut to MK Dons' loan defender Craig Morgan.
And they almost made the perfect start, Josh Johnson cutting free inside the area from Danny Williams and crossing into the six-yard area where John Mullins scrambled clear for the stunned home team.
But it was the Stags who created the first chance, Matt Hamshaw, on his return from suspension, weaving along the edge of the area before firing a shot over.
Another good cross from Johnson created mayhem in the home penalty area in the 17th minute, while at the other end Danny Reet's shot was deflected for a corner. From that flag kick Alan Sheehan blazed over when well placed.
But that poor beginning was all forgotten by the home fans in the 21st minute when Barker broke the deadlock. Hamshaw intercepted a clearance and his incisive pass then allowed Barker to round the keeper and roll his shot into an empty net.
Five minutes later the Stags should have doubled their lead from another fine Hamshaw through ball. This time full-back Gareth Jelleyman, playing on the left of midfield, hesitated and allowed the chance to slip away.
Dragons' danger man Johnson's third dangerous cross from the right by line almost created the chance for an equaliser 10 minutes before half-time, but Mullins managed to shield the loose ball out for a corner.
That proved so vital a minute later when Sheehan, struggling so much defensively to control Johnson, sprung the Wrexham offside trap with an exquisite lobbed pass, with Barker again racing clear to round the keeper and score.
The Stags were given a warning that the game was far from over in first half injury time when Mark Jones' clever footwork put Chris Llewellyn clear inside the six-yard area, but Stags' keeper Muggleton brilliantly blocked the point-blank range effort.
The home side almost made the points secure 10 minutes into the second half when Alex John-Baptiste headed a Hamshaw corner against the bar.
Hamshaw's surging run and fierce drive brought a flying save from Ingham and, from the resulting corner, John-Baptiste was again unlucky with his shot hitting the post and bouncing back to safety.
The unfortunate Stags were dealt another blow when Stephen Dawson was stretchered off after a challenge from Mark Jones.
But moments later the fortunes were reversed from the resulting free kick when the ball eventually fell to Danny Reet, who, despite looking yards offside, fired in from 10 yards for his seventh goal of the season.