AFC Mansfield had taken the lead through debutant Tommy Hannigan with a 12 yard low drive early in the 1st half.
Shirebrook equalised through Kieren Watson and then took the lead with a Liam Morris strike 3 minutes from half-time.
In between this Jason White had denied Watson twice from the spot. Saving the initial kick and then following up with another block to deny the Shirebrook hitman.
Both sides battled against a difficult and freezing by the minute surface to entertain the crowd in the 2nd half.
With 10 minutes to go of normal time Cotton produced a finish worthy of winning any game. His curling 25 yard free kick had ex Bulls keeper Dale Sheppard at full stretch but still found the top corner of the net.
The referee then found 12 minutes of added time but The Bulls stood firm and moved up to 4th in the league.
Full Match Report now on the Match Report page.