With so much at stake it was a tense 90 minutes and far from a good performance from Mansfield, but only results count now and Walker's precious 63rdminute finish for his 24th goal of the season was all that mattered as results elsewhere conspired to send Stags as high as second with just five games to play.
A poor first half saw few chances at either end.
Ryan Sweeney came on to add more footballing quality at the back for the second half and with Matt Preston in fantastic form alongside him and Krystian Pearce, they managed to shut out Cambridge, despite a late scare when Conrad Logan made a last minute save from Jevani Brown.
Walker's big moment was created by sub Jacob Mellis after a mistake by Gary Deegan had given away the ball.
It was Stags only real on-target effort of the afternoon but so important with rivals Bury and MK Dons both losing.
With Neal Bishop having shaken off a hamstring problem from last weekend's sparkling 4-1 win at Exeter, the Stags were unchanged.
Even though Sweeney and Jorge Grant were available again, after illness and injury respectively, they could only make the bench as boss David Flitcroft stuck with the players that did so well in Devon.
The Cambridge side included three familiar faces in ex-Stags Reggie Lambe, George Taft and Greg Taylor.
The opening minutes were scrappy with neither side able to string passes together, then Maris needed treatment after a collision with Walker.
Maris tried to carry on but had to limp off on 12 minutes, replaced by Deegan.
But we reached the midway point of the half with no chances created and neither keeper troubled.
It took 28 gruelling minutes before either keeper was troubled as Doyle-Hayes found Halliday in space on the edge of the box to send a deflected shot towards the far corner and force Logan to punch the ball away.
On 41 minutes a low shot from Doyle-Hayes took a deflection of Turner for a corner that could have gone anywhere with Logan stranded as home nerves jangled again.
Stags' first real shot came in the second of two added minutes, but Walker was well over from 25 yards as a poor half of football ended goalless.
Sweeney took over from Turner in the home back three for the second half.
Stags were furious on 51 minutes when Halliday's hand appeared to block the ball as Benning tried to get past him in the box, but no penalty was given.
As the game became a little more stretched, Logan twice had to pounce on dangerous low crosses into the six yard box.
Then a superb piece of skill by Brown saw him get to the left by-line and send over a cross that passed inches wide of the far post.
Stags badly needed a lift, so Mellis and Rose were sent on for Bishop and Jones on 59 minutes.
Rose joined Walker up front with Hamilton dropping to right wing back.
The big breakthrough duly arrived on 63 minutes after a mistake by Deegan. He lost the ball to Mellis who advanced and fed Walker to his left who smashed home a low finish for his 24th goal of the season.
On 75 minutes Stags conceded a dangerous free kick, central and 25 yards from goal, but Lambe was well over with his curling effort.
With three minutes to go Benning was booked for a rugby tackle on Halliday as he want past him towards the by-line, but Mansfield hacked the free kick clear as the seconds ticked away.
Brown ran into the clear in the final minute but, with home hearts in their mouths, Logan got his knees in the way of the finish.
Brown almost got away again in the four added minutes but his touch was too heavy and he lost the ball as seconds later the stadium erupted with celebration.
STAGS: Logan; Preston, Pearce, Turner (Sweeney HT); Jones (Rose 59), MacDonald, Bishop (Mellis 59), Tomlinson, Benning; Hamilton, Walker. Subs not used: Smith, Atkinson, Grant, Hakeem.
CAMBRIDGE: Mitov, Halliday, Carroll, Taft, Taylor, Amoo, Maris (Deegan 12), Lambe, Brown, Jones (Hepburn-Murphy 71), Doyle-Hayes (Coulson 74). Subs not used: Forde, Darling, Davies, John.
REFEREE: Craig Hicks of Surrey.
ATTENDANCE: 4,789 (307 away).
CHAD STAGS MAN OF THE MATCH: Matt Preston.