First-half goals from Anthony Howell and Matt Rhead did the damage, with Sido Jombati's goal for the home side coming too late to salvage a point as the Robins tasted defeat for the first time in 12 games.
Early Cheltenham pressure came to nothing and it was the Stags who opened the scoring after 21 minutes when Howell's 20-yard strike appeared to be deflected beyond Scott Brown in the home goal.
As half-time approached, Byron Harrison headed over for the Robins with Jombati drilling another effort off target.
And those misses were punished in injury time when Rhead powered home a header from a James Jennings corner.
Cheltenham piled the pressure on after the break but struggled to find a way through a solid visiting defence.
Mansfield substitute Colin Daniel was denied a third Stags goal by a decent save from Brown before Jombati netted an 87th-minute consolation, neatly turning home a Kemar Roofe corner.