With virtually the last kick of the match Forest Green Rovers agonisingly lost the point they desperately needed in their attempt to get away from the bottom three of the Nationwide Conference.
They created their first chance of the game in the sixth minute when Stuart Roberts' cross was flicked on by Jefferson Louis and Charlie Griffin's low drive forced Boro keeper Peter Keen to parry the ball away.
Griffin was unfortunate again in the 15th minute when Louis sent Roberts racing down the right wing and his low cross into the box was just too far in front of the striker to reach.
The Scarborough keeper was again needed three minutes before full-time when a stinging shot by Louis from outside the area looked to be heading for the left-hand corner of the net only for Keen to superbly tip the ball around the post.
Rovers' best chance came 13 minutes after the interval. Louis' shot was only half-cleared by the defence and Rovers midfield Matt Gadsby volleyed wide from six yards out.
The killer goal came three minutes into stoppage time as the Seadogs snatched the winner on the counter-attack.
An awful free-kick by Roberts was quickly cleared by the Boro defence as Rovers were caught on the back foot.
Keith Gilroy beat the offside trap and raced through the Rovers defence before slotting the ball into the far corner of the net.