Barnsley ended a torrid run of eight straight league defeats with a 2-1 victory at Oldham.
A dramatic late goal by debutant Kevin Long eased the pressure on manager Lee Johnson, who left Oldham to join the Tykes nine months ago.
Adam Hammill hit the post for Barnsley before they were denied twice in a matter of seconds, with Hammill's shot saved and Marley Watkins seeing his follow-up cleared off the line.
The visitors deservedly went in front on the half-hour as Hammill's trickery down the right led to Conor Hourihane drilling home a fine shot from 20 yards.
Ivan Toney could have doubled the lead and Oldham did not make their first clear chance until the 55th minute when Cameron Dummigan forced a save from Tykes keeper Adam Davies.
Toney wasted another opening for Barnsley when his close-range header came back off the bar, again after good work by Hammill.
Oldham levelled on 78 minutes when Dominic Poleon teed up Mark Yeates, who forced his shot past Davies from eight yards.
But Long, on loan from Burnley, lashed in the 89th-minute winner from close range after Simeon Jackson's shot was fumbled.