Only an equaliser in the third minute of stoppage time prevented Town progressing to the F A Cup Fourth Qualifying Round for the first time ever.
In a frenetic first half Ben Stephens fired Town into an eighth minute lead before Scarborough levelled on 19 minutes.
But four minutes later Dan Summerfield regained the lead for Town after Stephens penalty had been saved, and that looked to be the winner until that late heartbreak.
The replay will be at the MoodChimp Stadium on Tuesday evening.
A full report is now available under the First Team Match Reports Section.