A solitary Mark Convery strike earned York City all three points in an exciting end-to-end match.
The visitors played the last 40 minutes with ten men following captain Darren Barnard's sending off, but despite this had chances to sneak a point.
City's regular centre-back pairing of David McGurk and James Dudgeon were both missing and as a result, Daniel Parslow was partnered by new loan signing Luke Foster, who only joined York earlier this week from Lincoln.
Aldershot have had defensive problems of their own of late and leaked three goals in a midweek home draw with Tamworth. They gave a debut to teenager Curtis Osano who joined the Shots this week on loan from Premiership Reading.
City had to soak up early pressure but still managed to create the first chance through Convery, who shot over from 20 yards.
The Shots hit back with a fine left wing cross from David Lee, but Ryan Scott failed to direct his free header past home keeper Tom Evans.
The Minstermen went ahead on 12 minutes from a well worked corner. Steve Bowey passed short to Convery, who cut in from the left and then hit a firm low drive through a crowd of players and beyond Nikki Bull.
Marcus Gayle tried his luck from 30 yards in response after a neat turn. but his rising effort cleared the bar.
The, Craig Farrell started and finished a fine flowing move but his shot was straight at keeper Bull.
Just before the half-hour, City boss Billy McEwan was sent from the dugout for the first time in his career by referee Mr Matadar.
It took a couple of fine defensive blocks from debutant Foster and full-back Darren Craddock to keep Town at bay, before Craddock ran to the opposite end and his searching cross only just eluded both Farrell and Martyn Woolford.
On 37 minutes, Foster almost marked his debut with a goal, chesting down Convery's far-post cross only to half-volley over the bar.
City used the pace of Clayton Donaldson and Woolford to great effect and one scintillating run from Woolford, which took him 50 yards, ended with a fine shot from 20 yards being well gathered by Bull.
Shots boss Terry Brown made changes at the re-start with Ryan Williams and Louis Soares replacing Ben Harding and Joel Grant.
City earned an early free-kick and dead-ball specialist Nathan Peat tried his luck from 25 yards, but keeper Bull showed a clean pair of hands once again.
On 50 minutes the visitors were reduced to ten men after Barnard received his second yellow card, as he took Donaldson out neck-high after the pacy striker turned him.
Despite numerical advantage, City failed to capitalise, were often short of ideas and allowed the visitors back into the game.
Despite Woolford's effort from the edge of the area and substitute Dean Smith almost heading Farrell's cross into his own net, the better chances late on fell to Aldershot.
First, Williams seized on Parslow's only error of the night but mis-kicked ten yards out with only Evans to beat.
Then, the lively Williams saw Evans make a stunning save from his snap-shot following Scott's cross.
For a period of five minutes late on the Shots were reduced to nine men as Scott hobbled off for lengthy treatment, but returned as all the substitutes had been utilised.
There were five minutes of additional time and City managed to hold on for the vital three points.