The visitors came within inches of taking the lead inside the opening couple of minutes when Connor Goldson lashed a low ball across the face of goal that just eluded a Shrewsbury boot.
Goldson then headed a Liam Lawrence free kick straight into the arms of Lenny Pidgeley, before Jack Thomas threatened for the home side with a lofted effort from the edge of the box that was just too high.
Substitute Barnett nodded Shrewsbury into the lead on 50 minutes from just a yard out after Mark Ellis's lob took a deflection and beat Pidgeley.
The game was then delayed following an injury to the referee, and the replacement official was immediately called into action when Vadaine Oliver went down in the box under a heavy challenge from Jermaine Grandison. Much to the disappointment of the home fans, however, the referee waved away the Stags' appeals.
The decision spurred the home side on though, and they were nearly level on 71 minutes when Chris Clements volleyed narrowly wide after meeting a long ball forward from Thomas.