The sluggish Reds shipped three goals inside the first 32 minutes as the Black Cats stretched their lead over Daniel Stendel’s chasers to five points.
Kieffer Moore pulled two goals back either side of the break as the visitors tried to mount an heroic fightback. But Luke O’Nien wrapped it up for the home side with seven minutes to go.
Barnsley survived an early scare when Josh Maja fired wide from close range. But their luck was out when Aiden McGeady slotted home from the penalty spot after he had been fouled by Ethan Pinnock.
It got even worse when Maja spun in the box and fired home.
Liam Lindsay had a header hacked off the line, but the Reds had a mountain to climb when Lyden Gooch made it 3-0 following a devastating counter-attack by the hosts.
Moore slotted home a rebound after Jon McLaughlin had saved his initial effort four minutes before the break.
Cauley Woodrow hit the post, Cameron McGeehan had a shot blocked on the line before Moore headed home from Alex Mowatt’s corner.
Sunderland made it safe with seven minutes to go when O’Nien tapped in from McGeady’s pass.
Sunderland: McLaughlin, Matthews, Flanagan, Baldwin, James, Power, Honeyman, Maguire (Sinclair 84), Gooch (Oviedo 90), McGeady, Maja (O’Nien 59). Unused substitutes: Ozturk, O’Nien, Hackett, Mumba, Patterson.
Barnsley: Davies, Cavaré, Pinnock, Lindsay, Fryers (Brown 59), Potts (Moncur 77), McGeehan, Mowatt, Thiam, Woodrow (Adeboyejo 85), Moore. Unused substitutes: Jackson, Bähre, Pinillos, Greatorex.
Referee: A Madley (W Yorkshire).