Results elsewhere ensured that both teams’ League Two safety was ensured.
Sullay Kaikai gave the U’s the perfect start, powering home a free-kick from 40 yards out that Sascha Studer got hands to but could not keep out.
Kaikai capped a dominant first half for the hosts with a second goal two minutes before the interval. His short corner was returned to him by Josh Coulson, allowing him to fire a left-foot shot through a crowd of players and into the far corner of the net.
Mansfield were gifted a route back into the game after 64 minutes when Coulson under-hit a back pass to his goalkeeper and Lee Thomas squared the ball for Rakish Bingham to tap into an empty net.
After Kaikai went close with another free-kick from long range, Cambridge finally made the game safe two minutes from the end. Tom Elliott led a breakaway and spread the ball to Harrison Dunk, whose left-wing cross found Elliott unmarked to head beyond Studer.