The Minstermen eventually went down 4-3 to the Wombles despite losing Scott Kerr to a red card after only 35 minutes.
Wimbledon will now wait to learn whether they will face bitter rivals MK Dons, if they beat Cambridge City in their first round replay tonight.
An entertaining first half saw York forge in front after 22 minutes when Sebastian Brown punched Danny Kearns’s corner into his own goal.
On-loan Peterborough midfielder Kearns then thumped Brown’s crossbar with a thunderous 25-yard strike before the Dons equalised on 34 minutes.
Charlie Strutton drove into Michael Ingham’s bottom left-hand corner from 20 yards and referee Keith Stroud, having played advantage, then sent Kerr off for a reckless challenge on home midfielder Rashid Yussuff in the build up to the goal.
The Minstermen continued to look the more threatening side, though, with Jason Walker going close with two headers – one finishing narrowly wide and the other cleared off the line.
Matty Blair also struck the bar from 15 yards on the stroke of half-time.
The Dons went ahead on 79 minutes through Strutton’s second goal of the evening following a mistake by Chris Smith.
But York substitute Jamie Reed forced extra time on 90 minutes with his first touch as a substitute after Clarke Carlisle had won a far-post header from Michael Ingham’s free kick.
Two goals in quick succession in the first half of extra time, though, settled matters with strikers Byron Harrison and Jack Midson both on target, even though Reed added another goal in the 119th minute.
AFC Wimbledon: Brown, Fenlon (Osano, 62), Mitchel-King, Mambo, Cummings, Jolley, Gregory, Johnson (Harrison, 61), Yussuff (Long, 42), Midson, Strutton. Unused substitutes: Osano, Jaimez-Ruiz, McNaughton, Harrison, Antwi.
York City: Ingham, Oyebanjo, Smith, Carlisle, Fyfield, Parslow (Reed, 89), Kerr, Kearns, Blair, Walker (Johnson, 85), Chambers. Unused substitutes: McGurk, Musselwhite, Potts, Challinor, Doig.
Referee: K Stroud (Dorset).