The home team looked to be heading for victory until the 87th minute when Sam Jones scored a deserved equaliser after Steven Notman’s shot was parried by the Spartans keeper Blair Carswell.
David Greenhill had given Spartans the lead five minutes before half-time when his cross-cum-shot landed inside the near post after the wind decided to play a hand in events.
Penicuik almost equalised in the first quarter of the second half when Spartans player Ian McFarland cleared a shot off the goalline. The leveller from Jones prompted 30 minutes of extra time and a block from home player Adam Corbett ensured it remained 1-1.
Penicuik’s second penalty crashed back off the bar to hand Spartans hope and Scott Maxwell made it 2-1. Carswell saved the next penalty. Arron Scott made it 3-1 and Michael Herd scored the winner for 4-2.