Ally MacKinnon scored a stoppage time equaliser to earn Lowland League Spartans a Scottish Cup replay.
League Two Berwick Rangers edged ahead in the first half when Paul Willis drilled the ball into the top corner from outside the box.
Blair Henderson went close to adding to the visitors' lead as they dominated proceedings.
But MacKinnon bagged a leveller two minutes into injury time to ensure Spartans secured a fifth-round replay.
This gallery is empty.