SCOTT Taylor snatched a dramatic injury-time winner to keep Stamford's FA Cup dream alive in Tuesday night's preliminary round replay.
Taylor had been pushed up from defence into attack just two minutes before bagging a 92nd minute winner which saw off Stamford's plucky Ridgeons League Premier Division visitors.
The reward is now a winable first qualifying round trip to Sleaford Town on Saturday, September 13, with a 3,000 prize fund for the winners.
Daniels boss Dougie Keast recalled fit-again goalkeeper Martin Davies for the replay after an ankle injury kept him out of Saturday's first clash between the two sides.
Bobby White also returned to the Daniels defence while midfielder Jonny Bewers was called back from a loan spell with Rothwell Corinthians to boost a depleted substitutes bench.
Both sides failed to make the most of their best openings in the first period as Davies came charging off his line to block a low shot from Danny Beaumont who had broken free on the right.
Phil Stebbing had Stamford's best chance of the opening half as he latched onto Adam Cunnington's flick from Davies' long clearance, but his well-struck effort was superbly tipped away by John Higgs in the Magpies goal.
Stebbing turned provider four minutes into the second period as he laid in Ross Watson following a good forward run, but his low effort was deflected wide off Higgs' legs.
Stamford suffered a blow on the hour mark when Cunnington was forced off with an ankle injury and the Daniels missed his towering presence in attack.
Beaumont fired a free shot over the home crossbar after being teed up by Nicky Howell while Watson flashed two decent shots narrowly wide of the Dereham goal.
Dan Cotton sent a searing shot over the bar from distance before Dereham missed a good chance to take the lead with just two minutes remaining when Howell cut inside only to see his low shot smothered by Davies.
Watson had a header from a corner scooped away by Hicks before Taylor was moved into attack as the match appeared to be heading for extra-time.
And the switch was to prove inspirational as White's cross into the box fell kindly for Taylor to smash home through a crowd of players with virtually the final kick of the contest.
Stamford: Davies, White, Hallows, Taylor, Pearson, Watson, Cotton (Goodman 90), Gray, Cunnington (Bewers 60), Stebbing, Kirk. Subs not used: Guiney, Pledger.
Dereham: Higgs, O. Willis (Watts-Sturrock 75), Garner, Cousins, Eastoe-Smith, S. Willis, Howell, Smith, Beaumont, Barrett, Terrington. Subs not used: Furlong, Brien, Simmons, Baker.
Mercury man-of-the-match: Scott Taylor.
Match sponsor: HPC Homes.