York’s National League title hopes were dashed as Justin Amaluzor’s 75th-minute winner handed Altrincham a 2-1 victory.
Altrincham had led at the interval after Josh Stones diverted a Lewis Baines header into his own net.
York replied four minutes into the second half when Alex Hunt struck from long range but Amaluzor pounced after Harrison Male came off his line to put the visitors back ahead.
The Minstermen, now nine points behind leaders Barnet with a game in hand, pushed for a late equaliser with Ollie Pearce having a shot cleared off the line and Callum Howe heading against the bar but Altrincham held on.