Ferriby had propped up the table after being defeated by the Minstermen on Boxing Day, but Thompson’s 28th-minute winner led to Gary Mills’s men occupying the same position they had prior to Christmas.
The hard-working visitors had threatened early on when Danny Emerton curled narrowly wide from the edge of the box after home midfielder Danny Holmes had given the ball away.
York, meanwhile, went close when former Norwich midfielder Simon Lappin curled a free-kick against the outside of Rory Watson’s left-hand post.
But it was Steve Housham’s men who forged in front with only their sixth National League goal on the road all season.
Thompson kept his cool after being played clear through by Emerton, rounding home goalkeeper Kyle Letheren before finding the empty goal from a narrow angle.
After the break, Rhys Murphy wasted a great chance of an equaliser when he missed the target from 12 yards after being played in by half-time substitute Alex Whittle.
Murphy also headed in on 65 minutes, but the ball was adjudged to have crept out of play prior to Callum Rzonca’s cross from the right.
York City: Letheren; Rooney, Klukowski, Racine; Heslop, Lapin, Holmes (Rzonca, 56), Moke (Whittle, 46), Newton; Parkin, Murphy. Unused substitutes: Fry, Woodland, McDaid.
North Ferriby: Watson; Middleton, Gray, Oliver; Topliss, Sutton, Fallowfield, Emerton, Hare; Wootton, Thompson (Kendall, 78). Unused substitutes: Bateson, Stamp, Skelton, Fosu-Mensah.
Referee: Martin Coy.