Having led in the first-half through an instinctive header from Ollie Pearce, Maidenhead had drawn level in the second 45 when Tristan Abrahams volleyed home just after the hour mark.
York knocked on the door but had been unable to find that winner in Berkshire, with the home side admittedly impressive when defending.
But with all four minutes of added time played, Pearce produced once again when meeting Lenell John-Lewis’ flick on to send the travelling support wild.
And just one minute later, the result was put beyond doubt when Josh Stones added City’s third of the evening.
Three points keeps the Minstermen in the second position and narrows that gap with league leaders Barnet.
York were travelling down to a Maidenhead side that had found some needed form as of late with important wins against Oldham Athletic, Southend United and AFC Fylde, but had still struggled for consistency, after defeats to Yeovil Town, Barnet and Southampton’s academy in the National League cup – who won 6-0.
That lack of consistency meant that Devonshire’s side were within the National League relegation zone, but only on goal difference ahead of kick-off, with Aldershot Town’s win over Solihull Moors changing that this evening.
York themselves had been searching for consistency, having celebrated three wins on the trot, before losing at Barnet, and drawing, thanks to a last minute goal, against FC Halifax Town.
The match was also the first of two games in hand which the Minstermen had on the leaders Barnet, meaning they were able to close the gap to six points.
Hinshelwood had called for a higher intensity from his side after they had shipped two goals in the opening three minutes against Halifax, and with that in mind, he opted for a change of shape at the beginning of the contest.
Five changes saw Rory Watson, Jeff King, Marvin Armstrong, Ricky Aguiar and Dan Batty come into the 11, in place of Ryan Fallowfield, Harrison Male, Lewis Richardson, Cam John and Alex Hunt.
That saw King slot in at centre-back as Joe Felix returned to right-back, as Josh Stones and Ollie Pearce partnered one another up top.
Maidenhead on the other hand named just two changes in response to their 2-0 defeat to Yeovil at the weekend, with Joshua Johnson and Owen Cochrane replacing Kane Ferdinand and City loanee Thierry Latty-Fairweather, who was ineligible to play against his parent club.
City started with the needed intensity when Stones flicked King’s inswing cross wide, before they were dealt a scare when Shawn McCoulsky was brilliantly denied by Rory Watson from close-range.
Another impressive delivery from King saw Pearce head wide, before Maidenhead again tested the York defence, as Reece Smith met a deep cross and turned wide on the volley.
King soon sauntered forward with possession and stung the gloves of Ross from 25-yards, before Hinshelwood’s side found their breakthrough.
A teasing delivery to the front post from a corner was met by an onrushing Pearce, whose glancing header nestled past a helpless Ross.
It was a welcome lead to take into the break, with City deservedly in front against the Magpies.
But their joys were short-lived as a back pass from Tyrese Sinclair found Watson, who mistakenly failed to round Abrahams, instead picking up the ball in an attempt to avoid a howler between the sticks.
The referee had no choice but to yellow card Watson and award Maidenhead an indirect free-kick, which was incredibly blocked by Armstrong from Abrahams’ fierce effort.
It was perhaps a warning sign for the Minstermen, but one they failed to respond to as the hosts drew level.
After finding himself unmarked in the area, Abrahams volleyed a side-footed strike perfectly into the bottom left corner.
Hinshelwood looked to his bench with his only change of the night, as John-Lewis was introduced.
Chances fell the way of Stones, who missed the target, before a well-worked move saw Sinclair’s curling effort parried wide by Ross.
McCoulsky shot narrowly wide for Maidenhead, whilst City again missed a big opportunity as John-Lewis directed his header wide from close-range.
And as the fourth official announced four minutes of additional time, York shot into gear and scored the first of two stoppage-time strike.
A long, searching ball forward from Malachi Fagan-Walcott was flicked into the area by John-Lewis, which Pearce excellently took down before seeing his strike scurry its way into the bottom corner.
And just one minute later, two became three for the Minstermen as Stones weaved his way into the area and lifted a powerful strike over Ross – confirming a crucial three points for York.
MAIDENHEAD UNITED: ROSS, WELCH-HAYES, DE HAVILLAND, ONARIASE, MASSEY, COCHRANE, PETTIT, JOHNSON, SMITH, ABRAHAMS, MCCOULSKY
SUBS NOT USED: COLLINS, CLERIMA, BARRATT, KORBOA, AJOSE, STEWART
GOALS: ABRAHAMS (63)
YELLOW CARDS: SMITH (90)
YORK CITY: WATSON 6, FELIX 7, KING 8, HOWE 8, FAGAN-WALCOTT 7, SINCLAIR 7, BATTY 8, ARMSTRONG 6 (JOHN-LEWIS 7, 69), AGUIAR 6, STONES 8, PEARCE 8
SUBS NOT USED: MALE, MCLAUGHLIN, JOHN, CHADWICK, HUNT, RICHARDSON
GOALS: PEARCE (43, 90+4), STONES (90+5)
YELLOW CARDS: FAGAN-WALCOTT (9), WATSON (48)
YORK’S STAR MAN: OLLIE PEARCE. A brace, and an important one for the striker who ran endlessly.
REFEREE: RYAN ATKIN
ATTENDANCE: N/A
SHOTS (ON TARGET): 7 (3) | 11 (4)
CORNERS: 3 | 8
OFFSIDES: 0 | 1






































