But the battling Stags had to do it the hard way, coming from behind to win at Field Mill for the first time this season after conceding a goal after just 75 seconds.
Young keeper Jason White was to blame for the early breakthrough, but he redeemed himself with a crucial second-half save that paved the way for the crucial win alongside Boulding's treble.
The Stags had to field a makeshift defence for such an important match. Captain Jake Buxton was suspended while full-back Gareth Jelleyman and keeper Carl Muggleton were both injured.
And the reshuffled back five cost them dear after just 75 seconds when White fumbled Marc Pugh's 12-yard shot, allowing the ball to squirm through his grasp.
The brave Stags, fighting for their League lives, refused to let the goal dent their attacking approach and they continued to pour forward in search of the goals to keep alive their hopes of avoiding relegation.
Nathan Arnold and Jefferson Louis both had shots charged down, while Marc Tierney and Dave Hibbert were both fortunate to escape yellow cards for high challenges.
The Stags' best hope of an early reply was wasted by Louis as his close-range flick from Boulding's 15th-minute cross was blocked at the near post by Darran Kempson.
But their pressure was finally rewarded in the 22nd minute - Boulding touching in his 23rd goal of the season from Matt Hamshaw's clever lobbed cross, which left keeper Scott Bevan stranded, after a long pass from Keith Briggs.
Two minutes later the rampant home side were almost in front. This time Bevan redeemed himself with a fine low diving save to keep out Briggs' header from a deep Hamshaw corner.
On a rare Shrewsbury counter-attack, Hibbert headed Kevin McIntyre's cross wide from close range.
The Shrews were punished seconds later by a terrific turn and finish from Boulding, from yet another Hamshaw cross.
Hibbert curled a shot narrowly wide in first-half stoppage time as he continued to be the visitors' best hope of levelling.
Briggs went close from successive Hamshaw corners at the start of the second half, but first his acrobatic shot was blocked and then he glanced an effort wide.
Then Louis' turn and piledriver flashed over as the Stags looked for a crucial third goal.
Mansfield should have been punished for that miss when Pugh broke down the right and crossed to the unmarked James Constable but, with just the keeper to beat, he prodded the ball wide.
Substitute Guy Madjo's low drive was held by the diving White, who later did well to keep Pugh's fierce shot out.
Mansfield, tiring, were now limited to breakaways, and from one Boulding crashed a drive across the face of goal from a neat Arnold pass.
At the other end White beat away a close-range finish from Madjo after a weaving Pugh run and cross.
And that save proved so decisive three minutes from time when Louis' flick put Boulding clear and he fired under the advancing Bevan to clinch the vital victory.