The Minstermen could have had a commanding lead with the game only 10 minutes old before Fleetwood went ahead against the run of play.
Fleetwood came more into the game after the interval and York seldom threatened before the visitors sealed the win on 87 minutes.
Fleetwood, third in the table, were fortunate to survive a superb opening by the Minstermen with Matty Blair having a shot saved by Scott Davies’ outstretched leg with the game only 50 seconds old. Then Blair had a shot cleared from near the line while Jamal Fyfield had a fierce effort blocked and Michael Coulson was unlucky to see a 50-yard shot from the left beat Davies, only to hit the bar.
York could easily have been three goals up in the first 10 minutes. Patrick McLaughlin, putting in from the left, saw his curling shot go wide at the far post.
Then, as so often happens in football, Fleetwood went ahead totally against the run of play in the 36th minute when Junior Brown rocketed home a 25-yarder into Michael Ingham’s top right- hand corner.
Fleetwood grew into the game in the second half with Jamie McGuire having a header saved before David Ball ran clear from the inside of Ingham’s left-hand post, Chris Doig blocking the follow-up. Ingham again saved when Ball ran clear.
Jason Walker had a curling shot saved but York didn’t threaten often enough in the second period and Steven Gillespie won it with three minutes left.
York City: Ingham, Challinor, C Smith, Doig, Fyfield, Blair, Parslow (Bullock 70), McLaughlin (Taylor 83); Coulson (Johnson 70), Walker, Chambers. Unused substitutes: Musselwhite, Reed, J Smith, Carlisle,
Fleetwood Town: Davies, Beeley, McNulty, Mawen, Howell (Goodall 47), Barkhuizen (Nicholson 55), McGuire, Johnson, Marrow, Brown, Ball (Gillespie 83). Unused substitutes: Milligan, Parkin, Fowler, Maxwell.
Referee: G Sutton (Gainsborough).