It appeared Simon Grayson's men were more likely to lose after dominating from start to finish, when Simon Gillett suffered a rush of blood and kicked the ball into the hoardings after losing out at a throw and received his second yellow card.
But even though Crewe - who had cancelled out Andy Morrell's first-half volley through Nicky Maynard - had 11 minutes to turn the screw, Seasiders boss Grayson admitted: "I didn't take a striker off and stuck to playing 3-4-2 because I thought we could win the game.
"The lads kept going right to the end and rightly got the winner to cap a really fantastic day for us and the fans."
Grayson replaced Morrell with Keigan Parker and it was the striker who delivered the free-kick from which Barker rose highest to plant a downward header past Alex keeper Ben Williams for the winner.
Earlier, Morrell had given the visitors the perfect start when he connected sweetly to hook Wes Hoolahan's cross beyond Williams into the top corner in the third minute.
Crewe should have scored before that but Frenchman Julien Baudet blazed a juicy chance well over from in front of goal.
And visiting keeper Rhys Evans had little to do until Crewe hit back midway through the second half.
Blackpool always looked far sharper on the ball when they came forward and Scott Vernon might have extended their lead ten minutes before the interval when he sneaked in at the near post, but Williams' agile reactions kept the ball out.
And the striker went even closer shortly after the restart when his terrific right-footer from 25 yards was palmed over by Williams.
Crewe hardly deserved their 67th-minute equaliser when Gillett's foul on David Vaughan offered them free-kick, which appeared to have been wasted by Ben Rix.
From the resulting corner Baudet saw his header parried by Evans and when on-loan Coventry midfielder Isaac Osbourne returned the ball into the box, Rix's fierce drive was pushed by Evans into Maynard's path.
The teenager made no mistake from close range, but Crewe never looked like repeating the feat.
They were lucky not to have a penalty given against them when David Fox tumbled over the outstretched legs of Andy Taylor.
And Vernon twice went close to restoring Blackpool's advantage, before Gillett's red card seemed to have landed his side in the stew.
But despite a late effort from Osbourne, who drilled wide of the post, the Railwaymen couldn't make their man advantage count and Barker came up with the vital finish with his head.