The away side came close with the first real chance of the game early on as Jake Gallagher forced Kyle Letheren into a smart save from just inside the 18-yard box.
The Shots took the lead on the half-hour mark as Bernard Mensah beat the offside trap before firing past Letheren and into the back of the net from 10 yards out.
On the back of a four-match winless run, hosts York tried to come back into the game with Jack Higgins firing Aidan Connolly's corner over the crossbar, while Scott Fenwick had a goal ruled offside five minutes after the break.
But despite all the home side's efforts, Aldershot held on to take maximum points home.
Listen to York boss Jackie McNamara speaking to BBC Radio York
Report supplied by the Press Association.
Match ends, York City 0, Aldershot Town 1.
Second Half ends, York City 0, Aldershot Town 1.
Richard Brodie (York City) is shown the yellow card for a bad foul.
Matt Fry (York City) is shown the yellow card for a bad foul.
Matt McClure (Aldershot Town) is shown the yellow card for a bad foul.
Substitution, Aldershot Town. Josh Wakefield replaces Bernard Mensah.
Nick Arnold (Aldershot Town) is shown the yellow card for a bad foul.
Substitution, York City. Richard Brodie replaces Kaine Felix.
Substitution, Aldershot Town. Scott Rendell replaces Shamir Fenelon.
Substitution, Aldershot Town. Dion Conroy replaces Liam Bellamy.
Second Half begins York City 0, Aldershot Town 1.
First Half ends, York City 0, Aldershot Town 1.
Substitution, York City. Daniel Nti replaces Aidan Connolly.
Goal!  York City 0, Aldershot Town 1. Bernard Mensah (Aldershot Town).
Will Evans (Aldershot Town) is shown the yellow card for a bad foul.
Shaun Rooney (York City) is shown the yellow card for a bad foul.
First Half begins.
Lineups are announced and players are warming up.
Aldershot extended their unbeaten run to eight matches as they claimed a narrow victory over York at Bootham Crescent.