Teenager Max Clayton struck in stoppage time as Crewe edged a seven-goal thriller against 10-man Gillingham.
Nick Powell put the Alex in front with a stunning 30-yard strike before Jack Payne equalised for the Gills.
AJ Leitch-Smith and Powell gave Crewe a two-goal lead early in the second half, but Chris Whelpdale and Ashley Miller soon brought the hosts level at 3-3.
Gillingham's Danny Spiller was sent off for a foul on Jordan Brown before Clayton headed an injury-time winner.
It was the 17-year-old's fourth goal of the season and capped off an excellent week for the youngster.
Clayton, Powell and fellow Crewe youngster Ben Garratt in a 3-0 win against Poland at Gresty Road on Wednesday.
Gillingham, who have now lost 4-3 on three separate occasions this season, are a point away from a play-off place in League Two, while Crewe closed the gap between themselves and seventh-placed Oxford to just three points.
VIEWS FROM THE DRESSING ROOM
Gillingham boss Andy Hessenthaler told BBC Radio Kent:
"Another crazy game at Priestfield - it's amazing how many games like this we've been involved in.
"We were hanging on anyway but we weren't at it today, we looked tired. We're disappointed but we can't be too down, we've been on a decent run but it's a shame it's come to an end.
"When we got it back to 3-3 if we'd kept 11 men we might have gone on and won but Danny's made a poor decision, you can't jump in.
"It was hard enough 11 against 11."
Crewe manager Steve Davis told BBC Radio Stoke:
"It was a really entertaining game for the supporters. It had everything in it.
"We were brilliant for most of it and then pathetic for some of it.
"We were by far the better footballing side, and it was only a matter of time before we got that winner because we looked the more likely team to score.
"Nick Powell was exceptional today. His first goal was incredible. He just hit it out of nowhere with no back lift. It was unstoppable really."