Caretaker boss Paul Heckingbottom saw Barnsley lose on their travels at Gillingham in League One.
The Gills moved up to second in the table with goals from Dominic Samuel and Bradley Dack.
Samuel had put the hosts in front when he converted Rory Donnelly’s through-ball to finish past goalkeeper Adam Davies.
Conor Hourihane levelled for Barnsley with a spectacular volley but, a minute later, Davies parried Donnelly’s shot into the path of Dack who netted.
Hourihane saw a late long-range effort go wide, as Barsnsley’s push for the play-offs suffered a setback.