Richard Brodie scored against his former club to move Fleetwood closer to the Blue Square Bet Premier title.
The best chance in an uneventful first half fell to the visitors when Lee Fowler's free-kick deflected off York's James Meredith and hit the crossbar.
The hosts tested the league leaders after the break but Lanre Oyebanjo and Ashley Chambers failed to find the net.
Against the run of play, Brodie dummied the ball past two defenders and struck low under keeper Michael Ingham.
The Minstermen pushed for an equaliser but Meredith's shot was cleared off the line and Matty Blair's effort ricocheted off the inside of the post late on.
Victory means that Fleetwood will win the title and promotion to the Football League if they beat second-placed Wrexham at home on Tuesday.
VIEW FROM THE CHANGING ROOM
York City manager Gary Mills told BBC Radio York:
"As we say in football, you don't always get what you deserve and I think it's a bit hard on us today.
"I think a point would have been a big point for us - but we haven't got it.
"It's got to be taken on the chin. We've got to learn what men we are now, what we've about now.
"We're still fourth and what happens now whether it's poor performances, defeats, wins, draws, whatever - as long as we're in the top five come the end of the season it doesn't matter."
York City 24 Ingham 02 Oyebanjo 03 Meredith Booked 06 Parslow 23 Doig 27 Gibson 13 Bopp Booked (Moke - 45' ) 15 Tonne (Blinkhorn - 76' ) 17 Blair Booked 26 McLaughlin 07 Reed (Chambers - 64' ) Substitutes 16 Fyfield 18 Moke 19 Brown 10 Chambers 21 Blinkhorn Fleetwood Town 01 Davies 02 Beesley Booked 05 McNulty 06 Pond 13 Goodall 26 Cavanagh (Vieira - 19' ) 11 Till (Brodie - 51' ) 18 McGuire 27 Fowler 14 Mangan 33 Vardy Substitutes 23 Charnock 34 Stephenson 09 Brodie 10 Vieira (Seddon - 86' ) 19 Seddon