Mansfield leapfrogged promotion rivals Hull in this dour game which saw very few clear cut chances and was decided by a piece of individual brilliance from a Stags substitute Neil MacKenzie.
The first half was relatively low key and pretty even, with Mansfield winning a corner in the first few minutes, but City's new keeper Boaz Myhill was brought into action with a comfortable catch.
After a quarter of an hour, two corners in succession for Mansfield put a bit of pressure on City, before Stuart Green had his appeal for a penalty waved away after appearing to have been shoved in the box.
After 21 minutes, a dangerous shot from Junior Mendes flew inches across the goal, with no-one there to slot in what would have been a certain goal.
Four minutes later, Lee Williamson also had his appeal for a penalty turned down.
After half an hour, a 20-yard shot from Iyseden Christie flew well over the bar, but sparked the massive Mansfield away following into life.
Five minutes before the break the best chance of the game fell to Christie, who shot wide with an open goal at his mercy.
At the other end, Green ran clear and forced a save out of Kevin Pilkington. Stuart Elliott then saw his header saved before a shot from Ben Burgess hit the right post in the very last seconds of the half.
After the restart, a thundering shot from Liam Lawrence was blocked by City's defence, before a header from Elliott was plucked out of the air by Pilkington.
Minutes later a header from Jason Price went wide as City began to put on the pressure.
Williamson and Tony Vaughan both went close before substitute Wayne Corden looped a shot inches over the bar on 77 minutes.
But it was substitute MacKenzie who stole the vital three points with a great individual goal from 25 yards which beat everyone and left Myhill with no chance.
City substitute Danny Allsopp went close twice in a frenetic last few minutes for City but they could not produce anything to match the style of the goal that was the difference between the two sides.