They had trailed as early as the fifth minute, when Ryan Wynter side-footed home the rebound after George Cator’s shot was saved.
After a goal-line clearance had denied Stamford, they levelled things up on 72 minutes from the penalty spot after Mike O’Reilly handled on the line, Harry Vince converting to Curtis Pond’s left.
With O’Reilly shown a red card as a result, Stamford made the most of their numerical advantage, with Tom Siddons scoring the winner in the final minute.
Leek Town are level on points with Stamford at the top after they thrashed previous leaders Carlton Town 4-0.
Tim Grice’s hat-trick earned the Staffordshire side their 10th win of the season - and they have a game in hand on Stamford.
Cleethorpes Town are third after beating Belper Town 2-1 thanks to Scott Vernon’s late penalty.
Frickley Athletic recorded their fourth successive win, beating Market Drayton Town 4-1 - Jacob Hazel scoring a brace - while Newcastle Town lost for the fourth successive game, beaten 4-2 at Stocksbridge Park Steels.
Loughborough Dynamo were 2-0 winners over Wisbech Town, with Ilkeston defeating Sutton Coldfield Town by the same score to go fourth.
The game of the day came at Kidsgrove Athletic, who shared six goals at home to Sheffield.
Sheffield led three times, with goals from Cody Prior and Rieves Boocock (2), cancelled out by Ruben Wiggins-Thomas (2) and James Butler.
Glossop North End recovered from conceding a seventh minute goal to win 3-1 at Lincoln United and Kevin Bastos scored a hat-trick to fire Spalding United to a 4-1 win at Worksop Town.
Featured photos courtesy of Dave Birt - Chasetown v Stamford