Simon Johnson's double for Barnsley was not enough to overcome Oldham, who are now unbeaten in six matches at Oakwell.
Barnsley took an early lead when Antony Kay flicked on a Stephen McPhail free-kick and Johnson headed home.
Oldham equalised when New Zealander Chris Killen connected with a cross from Marc Tierney to loop in a header.
The visitors went ahead when Gareth Owen's free-kick found Luke Beckett and he planted a firm header past Flinders only for Johnson to level late on.