Ian Lawson returned from the wilderness to steer third division Bury into the third round of the LDV Vans Trophy.
The former Huddersfield and Stockport striker has suffered a miserable season so far due to a loss of form and lack of fitness.
However, with first-choice marksmen Jon Newby and player-boss Andy Preece nursing injuries Lawson was given his chance as the Shakers made six changes from the team beaten by Torquay last Saturday.
And Lawson, in his second spell at Gigg Lane, came up trumps with a 28th minute winner after Barnsley had dominated the early stages. But the Oakwell outfit missed a succession of chances, including a close-range header by Rory Fallon and Lawson made them pay with a right foot volley from 15 yards.
Kevin Betsy struck a post for the visitors in the second half but Barnsley's luck remained out and Lawson could easily have finished with the match ball after he too scuffed a couple of good opportunities