Jason Walker scored twice in the last seven minutes on his York debut as they came from behind to beat Ebbsfleet.
City's Andre Boucaud hit the bar from 25 yards before the Fleet saw Tom Phipp sent off for the hosts for a professional foul.
Callum Willock gave the hosts the lead from close range but striker Walker levelled from a penalty when Joe Welch felled Ashley Chambers.
And the summer signing headed home Lanre Oyebanjo's cross to seal it.
Ebbsfleet United: Welch, Stone, Simpemba, Easton, Herd, Phipp, Fakinos (Stavrinou 65), Marwa, West, Shakes (Willock 75), Enver-Marum. Subs Not Used: Edwards, Howe, Azeez.
Sent Off: Phipp (69).
Booked: Marwa, Welch.
Goals: Willock 80.
York: Ingham, Oyebanjo, Smith, McGurk, Meredith, Moke, Boucaud, McLaughlin, Blair, Walker, Chambers. Subs Not Used: Parslow, Reed, Potts, Fyfield, Henderson.
Booked: McGurk, Smith, Walker.
Goals: Walker 83 pen, 90.
Ref: Tim Robinson (West Sussex).