They were in charge for most of the contest, but had to wait until late in the first half before Ben Close impressively broke the deadlock.
John Marquis then doubled the advantage in stoppage-time, only for a Cauley Woodrow stunner to ignite hopes of a comeback for the visitors.
They were quickly extinguished by Ronan Curtis, however, and Christian Burgess wrapped up a convincing victory, before Conor Chaplin grabbed a late Tykes consolation.
Kenny Jackett made three changes from the side that beat Bolton in the league the previous weekend.
Andy Cannon, Close and Ryan Williams all returned to the starting line-up, with the latter facing his former club.
Ellis Harrison and Marcus Harness both dropped to the bench, while Cameron McGeehan was unable to feature against the side he is on loan from.
Meanwhile, there was a familiar face in the opposition line-up, as ex-Fratton favourite Chaplin played up front.
The contest took a while to get going, but it was Pompey who looked the more threatening side as the first half progressed.
It was the skipper who had the first attempt, with Tom Naylor drilling a low shot narrowly wide when Cannon laid the ball into his path.
Cannon was then not quite able to get on the end of a Williams delivery after Curtis had ridden a challenge in the middle of the pitch and picked out the winger.
The Blues were looking particularly dangerous on the break, although had yet to test Brad Collins between the sticks.
But the keeper might have gifted the hosts an opener midway through the half, with his kick ricocheting off Marquis and rolling just past the post.
Collins then had to get down low to his right to keep out a low effort from Curtis following another pacy counter-attack.
But the deadlock was broken on 37 minutes after Cannon had not been afforded any space to get a shot away.
The midfielder instead laid the ball off for CLOSE to superbly arrow home from the edge of the box, drawing cries of ‘he’s one of our own’ from the Fratton faithful.
Collins then stopped his side falling further behind just before the break, superbly parrying Curtis’ shot behind following good work from Williams.
It was only a brief respite for the Tykes, though, as Curtis met the resulting corner from Steve Seddon and his header was touched over the line by MARQUIS.
Barnsley showed more attacking intent once the action restarted, although the Blues soon almost extended their lead further.
Curtis met a cross from Williams and his header hit Marquis, with Collins doing well to stop the ball crossing the line.
The hosts were on top and playing some neat football, as they looked to put the tie out of the Reds’ reach.
But their lead was halved from nowhere on the hour mark, as Woodrow hit a stunning 30-yard strike that left Alex Bass with no chance.
And Barnsley should have soon been level, with Jacob Brown wastefully prodding wide from a few yards out.
He was made to pay his profligacy just a few seconds later, as CURTIS raced onto a long ball over the top by Bass, held off a defender and fired home off the inside of the post.
It had been a quiet return for Chaplin, but he had two opportunities in quick succession to hurt his former club.
His first attempt was bravely blocked by Burgess, while the striker was then unable to beat Bass from an acute angle.
From coming to the rescue at one end, BURGESS then scored the Blues’ fourth goal of the afternoon – just a week after opening his account for the season.
Williams’ effort was deflected behind for a corner, which Seddon whipped into the box for the centre-back to firmly head into the net.
That was Williams’ last contribution, with the winger replaced by Harness, exiting the pitch from the north side and enjoying a standing ovation as he made his way around the pitch.
The newcomer almost added a fifth goal on 82 minutes, but Collins was quickly off his line to prevent him from converting Curtis’ pass.
Pompey fans were certainly enjoying themselves, singing songs about Wembley and paying tribute to Chaplin.
And the Barnsley striker did reduce his side’s deficit in stoppage-time, following up to find the net after Bass had denied Brown.
But the hosts had comfortably done enough to book their place in Monday evening’s fifth round draw – the first time they have reached that stage since getting to the final in 2010.
Pompey (4-2-3-1): Bass; Bolton, Burgess, Raggett, Seddon; Naylor (c), Close; Williams (Harness 78), Cannon (Evans 90), Curtis; Marquis (Harrison 90+2)
Goals: Close 37, Marquis 45+1, Curtis 62, Burgess 76
Subs not used: MacGillivray, Whatmough, Haunstrup, Hawkins
Barnsley (4-1-2-1-2): Collins; J.Williams, Sollbauer, Andersen, Oduor; Halme (Dougall 69); Thomas (Mowatt 46), Ritzmaier; Woodrow (c); Brown, Chaplin
Goals: Woodrow 60, Chaplin 90+1
Subs not used: Radlinger, Ludewig, B.Williams, Styles, Schmidt
Referee: Graham Scott
Attendance: 13,286 (681 away fans)