Connor Goldson headed the hosts into an early lead before Joe Jacobson's deflected free-kick doubled the advantage in the 37th minute.
The Shrews looked set for a convincing win when Akwasi Asante, on loan from Birmingham, made it 3-0 soon after the restart.
But Pompey, in Whittingham's first match since he was appointed manager on a permanent basis, then showed plenty of fight with goals from strikers Ashley Harris and Patrick Agyemang to set up a nervy finish for Graham Turner's team.
"There is a lot going on in the players' heads at the moment," said Whittingham. "There has been a lot of talk about who is staying and who is going and when you have a group of players who are not quite sure where their future is then there is a lot for them to think about.
"It was not really the way we wanted to finish the season but the last half an hour was very good."
Whittingham, reflecting on Pompey's trying season, added: "Football is a rollercoaster ride - its up and downs all the time.
"We've reached some depths on that rollercoaster and it culminated in that peak last Saturday.
"It's come back down a little bit today but the last 30 minutes or so were good."