Keith Gilroy made a spectacular return to the McCain Stadium after his absence due to a broken foot, when he provided Scarborough with the winner two minutes into stoppage time.
While Stanley dominated much of the first half, Scarborough found new enthusiasm after some tough talking in the dressing room from manager Russell Slade.
"We scored three good goals - unfortunately one of them was unjustifiably disallowed," said Slade later.
"We were well worth the result because we dug in despite having a first-half goal turned down for offside, and the video shows it wasn't." Stanley, who could have been comfortably ahead in the first half, welcomed back two veterans, centre-back Steve Halford and midfielder Andy Gouck, who opened their account with a fine 26th minute goal from a corner by man of the match Rory Prendergast.
It landed in the middle of a ruck of players in the goalmouth, for Gouck to nip in and head the ball home.
The visitors repeatedly put the home defence under pressure thanks to Lutel James who went close three times, and Prendergast forced Scarborough keeper Leigh Walker to dive full-length across the goal to save his on-target 25-yard volley.
Tony Hackworth found the net for Scarborough but it was disallowed for offside despite strong protests from the Seadogs.
Stanley were unlucky not to score through Jonathan Smith, Paul Mullin and James before the break, while at the other end, Wayne Gill set Hackworth up with a great chance but he put the ball narrowly over the bar under pressure from a wall of defenders.
Scarborough showed more confidence towards the break as Stanley struggled to convert their superiority into goals.
The home side's hopes were raised shortly after the re-start when goalkeeper John Speare only saved Kevin Nicholson's 18 yard drive at the second attempt and then Clint Marcelle, who was on top form, beat three defenders and shot just inches wide with the keeper beaten.
Marcelle, who had master-minded most of Scarborough's initiatives, proved to be the architect of their first goal when he ran in to latch on to a Speare goal kick and crossed to Hackworth who drove the ball hard into the left-hand corner of the net in the 61st minute.
But Stanley continued to look dangerous, winning the ball in midfield. Slade's decision to put on Chris Senior in place of Mark Quayle injected new life into the Scarborough attacking.
Hackworth had a good chance cleared off the line by Darren Kempson and then two minutes later Gilroy produced the winner.
Stanley threw everyone up front in the closing seconds, led by Prendergast and Mullin in a desperate attempt to snatch a late point, but without success.