Loan signing Paul McShane made his debut for the Tykes as a replacement for centre-back Stephen Foster who has been ruled out for six weeks with a torn thigh.
Midfielder Hugo Colace has also been ruled for a month with a torn abductor muscle. Defenders Jay McEveley and Luke Potter remain sidelined.
The Nigerian striker came on as a late substitute and provided Pompey with the cutting edge they had lacked for most of the match, firing past Luke Steele with 10 minutes remaining.
Barnsley had the first chance of the game after only two minutes, Danny Haynes latching onto a long ball but blasting over the bar.
Neither side could find an attacking rhythm after the restart, Dave Kitson leaving it until the hour mark to test the goalkeeper again.
The home fans cheered the introduction of veteran striker Nwankwo Kanu in the 71st minute and his presence immediately sparked Pompey into life. He was unlucky not to put Mullins through on goal with one of his first touches of the ball.
After 83 minutes, the former Arsenal man proved his worth to Cotterill with the winning goal. Halford floated a ball into the box for Kanu to rise above Steele and head into the bottom corner.