Jimmy Bullard's 21st minute penalty put the visitors in front, before Liam Lawrence levelled from the spot before the hour.
Matt Fryatt came off the bench to grab a debut goal following his £1.2million move from Leicester, and Nick Barmby soon made it 3-1 to City before Pompey midfielder Greg Halford set up a grandstand finish.
"It was an exciting and pulsating game," said Pearson. "It was not our best performance of the season, but to come away from home to a place like this and score three goals is very good.
"I'm delighted with the result because we needed to be brave and show a lot of spirit, and the players did that.
"I'm sure Portsmouth will say they should have got something out of the game and they probably should have, but I would have taken that result beforehand."
Source: PA
Source: PA