York produced an impressive performance under caretaker boss Viv Busby to clinch victory over Crawley.
City took the lead through Lee Grant's close-range header five minutes before the break.
Crawley equalised when Simon Wormull set up Danny Marney to tap home, only for York to go back in front when Paul Robinson struck from 20 yards.
Andy Bishop wrapped up the points with a clinical third to move the Minstermen away from the danger zone.
York: Stockdale, Smith, Brass, Grant, Davies, Donovan, Groves, Dunning, Merris, Bishop, Paul Robinson (Yalcin 89).
Subs Not Used: Porter, Law, Stewart, Webster.
Goals: Grant 40, Paul Robinson 69, Bishop 85.
Crawley Town: Smith, Judge, Simpemba, Dolan, Palmer (Mapes 75), Harkin, Armstrong, Wormull, Jenkins (Kember 63), Tait (MacDonald 70), Marney.
Subs Not Used: Little, Davidson.
Booked: Dolan, Kember.
Goals: Marney 51.
Ref: A Page (Ilkeston).