Michael Owen broke the deadlock on 57 minutes when he was played through by Shola Ameobi.
It was his eighth goal for the club and only his second at St James' Park.
Owen left the field to warm applause with seven minutes remaining, and his replacement, Oba Martins, wrapped up the win within three minutes with a superb volley.
Allardyce: "It was a comfortable performance tonight, we were never in any trouble at any stage of the game apart from maybe getting a little over-frustrated in the first half and not being able to break down Barnsley as much as we would have liked."
Barnsley boss Simon Davey: "We have lost the game, so we are disappointed and we are out of the cup.
"But the performance, I thought, was fantastic. The players did the club proud.
"We had to make six changes from Saturday and it proves we have got a good squad now that can compete at Championship level."