Goals from Jed Davies and Jermain Hollis either side of a Will Hayhurst penalty were enough for the Pitmen to snatch all three points.
The deadlock was broken less than a minute into the second-half by the visitors as Davies fired in a goal of the season contender from the left wing, with Ed Hall powerless to stop it.
The Celts started to get on top and their pressure eventually told when Nathan Turner was felled in the box by Matt Curley, with Hayhurst tucking home the equaliser less than 15 minutes from time.
Hayhurst was inches away from giving Farsley the lead just minutes later as his curling free-kick was tipped on to a post by Bursik before Hednesford scrambled the ball clear.
Farsley were made to pay for their missed opportunities as, three minutes from time ,Hednesford scored the decisive goal, Hollis thumping the ball into the back of the net as the hosts were unable to clear their lines.
In Division One East, Brighouse Town and Ossett United were forced to settle for a share of the spoils following a fiery 2-2 draw at the Yorkshire Payments Stadium.
Aiden Chippendale broke the deadlock for Ossett before Marley Grant levelled moments before the break.
A calamitous own goal from James Knowles then handed Brighouse the advantage after which they were reduced to 10 men following Adam Jones’ dismissal. Less than a minute later George Grayson drew United level, then Brighouse’s Gabriel Johnson and Ossett’s Adam Porritt were sent for an early shower.
A stoppage-time winner from Gavin Allott handed Frickley Athletic all three points as they defeated Cleethorpes Town 2-1. Joshua Batty gave the hosts the lead early in the second half, Jacob Hazel and Allott striking to complete the turnaround.
Goals from Sean Taylor, Iulian Petrache and Ben Sayer saw Morpeth Town defeat Tadcaster Albion 3-0, while Robert Morgan and Bradley Fortnam-Tomlinson ensured Stamford beat Pontefract Collieries 2-1 despite Michael Dunn’s strike.