Skipper Baldock put his side in front on 13 minutes with a close-range shot from Martin Paterson's low cross.
It was against the run of play and County deservedly equalised on 29 minutes when no defender picked up Haydn Hollis at a left-wing corner and he directed a downward header past Simon Moore.
Hollis went from hero to villain four minutes from time when his poor header back to Bartosz Bialowski was pounced on by Baldock, who won a 50-50 challenge with the goalkeeper before shooting home from 10 yards.
Baldock has netted 23 times in League fixtures and his brace in this game put him in pole position to end the season as the division's leading scorer.
Cotterill said: "I hope and believe Sam can do it. He deserves every goal he scores because of the amount of running he does in games.
"I told him at half-time not to be satisfied with one in this match. He is a clever player and whatever you ask him to do you don't have to say it often.
"We didn't deserve to win, but I am making no apology for that because since I have been here there have been many occasions when we didn't get full reward for our efforts.
"I wish County all the best in their relegation because they do not deserve to go down playing like that."