Junior Clayton Donaldson opened the scoring after half an hour, before Mansfield latched on to a sloppy clearance from Ian Goodison to equalised.
However, Nicky Mohan headed home a free kick to put City ahead at the interval.
Matt Bloomer replaced Goodison at half time, and Rob Matthews shortly made it 3-1.
20-year-old Australian midfielder Adrian Caceres - on trial from Southampton - then struck twice to put the match beyond doubt.
Nathan Peat added a sixth after coming on for Donaldson to keep City's promotion chances intact.
City line-up (4-4-2): Glennon; Petty, Mohan, Goodison (Bloomer), Holt (Burton); Morley, Whitmore, Caceres, Matthews; Rowe, Donaldson (Peat).
Un-used subs: Dixon, Kaveney.