Super-sub Amadou Bakayoko did it again as his late winner earned Wanderers the dramatic victory that keeps their season alive.
Dropped points against bottom club Crewe would almost certainly have ended any interest in the play-offs.
But with manager Ian Evatt asking his players to try and go out and win their final eight games to keep the clubs above them looking over their shoulders, Bakayoko’s 90th-minute strike arrived in the nick of time.
The striker – about to link up with the Sierra Leone squad for the first time – has scored some big goals this season, often via the bench.
And he did it again with another instinctive finish to claim his 11th goal of the campaign and turn an afternoon of frustration into one of relief and reward as second-half pressure finally paid off to earn a second successive away win and momentum to carry forward to a derby clash at Wigan in a fortnight’s time.
A second league start for Kieran Sadlier in place of the injured Marlon Fossey was the only change to the Wanderers’ side which had seen their seven-game unbeaten home run ended last time out to make this virtually must-win game.
Sadlier’s full debut had come on another poor playing surface at Burton and again the wideman had to try and negotiate a pitch short on grass.
His excellent low cross in the opening moments, which just eluded Dion Charles, was one of the few moments of quality on show in a disjointed first half held up for 10 minutes following an apparent accident in one of two packed away sections of the ground.
Neither side retained possession long enough to gain any measure of control and with passing and ball retention a tricky business on a wind-blasted, bobbly surface chances were virtually non-existent.
Will Aimson had to be alert to deny Luke Offord after a cross from Tom Lowery had created Crewe’s best opening as the Railwaymen battled to improve on a run of 11 defeats in 12 games to aid their chances of beating the drop.
The Wanderers’ defender also went close at the other end when he sent a looping headed onto the top of the net from a George Johnston cross.
And with the final kick of the lengthy period of first-half stoppage time, the Whites forced Crewe keeper David Richards into his first save when he did well to keep out an awkwardly bouncing free-kick from Sadlier.
Knowing they needed to do plenty more, Wanderers raised the tempo and increased the level of intensity at the start of the second half.
And they were rewarded with their first real openings as they set the tempo for what was to come.
A delightful Aimson cross picked out Afolayan to connect with a header which brought a sharp save out of Richards.
And then after MJ Williams had fired just wide, the Crewe keeper was relieved to see an Afolayan effort from 20 yards hit the foot of a post rather than sneak inside as he watched the ball go past him.
Richards was becoming a key man and with 25 minutes to go he made another smart block to Ricardo Almeida Santos and deny the Wanderers’ skipper his first goal for the club after he had burst into the box and let fly with a fierce drive.
Santos hadn’t put a foot wrong on the rare occasions he was tested defensively but as time began to tick away he was caught out when allowing the ball to drop beyond him to give Bassala Sambou an opening he was unable to take with a tame lob at James Trafford, who had been a virtual spectator.
With the deadlock persisting Evatt used his three substitutes and again the switches worked.
Kyle Dempsey saw a shot blocked with his first touch as Crewe looked to doggedly hold on to try and stop the rot.
And with a minute, Elias Kachunga drove forward to win the free-kick which finally produced a winner as Wanderers’ persistence and never-say-die spirit paid off.
Sadlier’s set-piece struck a post and when Johnston fired the ball back in, Bakayoko reacted superbly to steer home another priceless late goal to take with him on international duty and, at the same time, keep the home fires burning.
Wanderers: Trafford; Aimson, Santos, Johnston; Sadlier, Williams (Dempsey 80), Morley, John; Afolayan (Kachunga 75); Charles, Bodvarsson (Bakayoko 72). Substitutes: Gordon, Baptiste, Thomason, Amaechi.
Booked: Afolayan
Crewe: Richards; Johnson, Offord, Williams; Sambou, Lundstram, Lowery, Harper (Porter 77), Ainley (Griffiths 83); Finney (Murphy 70), Long. Substitutes: Jaaskelainen, O’Riordan, Lawton, Salisbury.
Booked: Johnson
Referee: Sam Purkiss
Attendance: 5,895 (Wanderers’ 2,313)