Levi Mackin's first-half penalty earned Alfreton their first Blue Square Bet Premier win of the season at York.
The former York midfielder fired past Michael Ingham from the spot after Andre Boucaud felled Paul Clayton.
Patrick McLaughlin had earlier missed a clear opening for the hosts, firing straight at Alfreton keeper Dan Lowson when clean through.
Lowson also saved well from Adriano Moke late on as Alfreton held on to climb off the bottom of the table.
York: Ingham, Parslow, McGurk, Smith, Meredith (Fyfield 63), Boucaud (Challinor 57), Kerr, McLaughlin (Reed 46), Chambers, Walker, Moke. Subs Not Used: Pilkington, Potts.
Alfreton Town: Lowson, Brown, Young, Matt Wilson, Franklin, Mullan, Franks, Streete, Mackin, Clayton (Jarman 83), Senior (Ellison 89). Subs Not Used: Moult, Hall, Hawes.
Booked: Franks, Franklin, Streete.
Goals: Mackin 43 pen.
Ref: Stephen Smith (County Durham).