Ben Tomlinson's second-half winner for Alfreton at Field Mill ended Mansfield Town's 10-match unbeaten run.
The Stags took the lead on 35 minutes when John Dempster fired home Lee Beevers' cross from close range.
However, less than two minutes later, Paul Clayton headed in Josh Law's free-kick to level the scores.
Tomlinson scored from the edge of the box to put Alfreton ahead on 57 minutes but both Jake Speight and Matt Green missed late chances to snatch a point.
Mansfield are now eighth in the Blue Square Bet Premier, six points adrift of the play-offs, while Alfreton are up to 15th.