Barnsley are right back in the scrap for the League One play-offs after Sam Winnall’s late penalty winner finally saw off battling Roses rivals Oldham.
The Johnstone’s Paint Trophy winners are just three points adrift of the top six, with five games remaining.
Predatory talisman Winnall now has 20 goals for the season as he struck late to add to his earlier effort in the dying minutes of the first half.
Reds’ caretaker boss Paul Heckingbottom had made two changes to his starting line-up.
In a bid to bounce back from the disappointing home defeat to Chesterfield, Ivan Toney was recalled up top to partner Winnall, while the now fully-fit Marley Watkins stepped up at Lloyd Isgrove’s expense. Isgrove and Ashley Fletcher were among the substitutes.
It proved to be an end-to-end and at times feisty opening 20 minutes.
John Sheridan’s Oldham crafted the first opportunity as they looked full of confidence.
Mike Jones found Doncaster loanee Curtis Main in the box, but the striker poked a disappointing effort wide as he looked destined to bag for the third game in a row.
The Reds responded with defender Alfie Mawson rising superbly to nod wide as he met Conor Hourihane’s in-swinging free-kick.
Main fluffed another decent chance, firing straight at grateful ‘keeper Adam Davies when he ought to have found the target.
The woodwork came to Oldham’s rescue in the 27th minute. The hosts put together a terrific move, which culminated with Toney picking out Winnall, who in turn fired against the post.
After a lengthy stoppage when early Oldham substitute Brian Wilson ended up leaving the field on a stretcher, it was the visitors who resumed impressively.
However Main was again guilty of a woeful miss, lashing a shot glaringly over from just inside the Reds’ box.
Oldham skipper Liam Kelly - a rumoured target for the Reds last summer - was next to go close when he shot straight at a grateful Davies.
It was the Reds who had the final word of the opening period, though. They went in front in the fourth of NINE first-half stoppage-time minutes as Winnall routinely headed home a Hourihane corner-kick.
It was the first goal Oldham had conceded in more than 400 minutes of football.
The Reds thought they had doubled their lead five minutes after the restart.
Toney lashed home a smart shot, but he had strayed offside as he charged in to meet Winnall’s cross.
In the 52nd minute the home faithful were appealing for a red card to be shown to Oldham’s Anthony Gerrard when he tripped the on-rushing Toney, but referee Mr Hooper opted to merely dish out a yellow despite the Reds’ striker appearing to be almost through on goal.
The game was drifting a little as the three-quarter mark approached, but crucially the Reds were holding onto their lead.
There was a threat from Oldham just past the hour mark, only for young half-time sub Jack Tuohy to blast an effort awfully high and wide just as he was charging into the Barnsley box.
The visitors made no mistake in the 68th minute however. Main finally grabbed the goal he had been threatening all evening, tucking home neatly as he met Cameron Dummigan’s cross.
The Reds almost regained the lead, but for the second time Winnall was denied by the woodwork as Oldham ‘keeper Joel Coleman superbly palmed a well-struck shot against the post.
But Winnall coolly slotted home the winning goal from the spot after Tareiq Holmes-Dennis had clumsily bundled Hammill over in the box.
Barnsley: Davies, Bree (G Williams, 42), Roberts, Mawson, White, Watkins (Scowen, 87), Brownhill, Hourihane, Hammill, Toney (Fletcher, 65), Winnall. Subs not used: Townsend, Nyatanga, Chapman, Isgrove.
Yellow cards: Winnall (55).
Oldham: Coleman, Dummigan, J Wilson, Gerrard, Holmes-Dennis, Dieng, Kelly, Jones (Tuohy, 46), Winchester (B Wilson, 20 (Forte, 33)), Cassidy, Main. Subs not used: Cornell, Brown, Mills, Croft.
Yellow cards: Gerrard (52), Coleman (55), Dummigan (74).
Referee: Simon Hooper (Wiltshire).