The second-placed side snapped a run of three matches without a win when battling past managerless Pompey.
The contest was settled by a calamitous 32nd-minute own goal as Pompey keeper Craig MacGillivray punched a Harrison Burrows corner into the back of defender Rasmus Nicolaisen.
Pompey, without injured leading scorer John Marquis in their first game after the weekend sacking of Kenny Jackett, applied plenty of pressure in the second half but Posh stood firm.
Jack Whatmough headed the visitors’ best chance wide as they suffered a sixth defeat in their last eight league games.
They remain outside the play-off places while victorious Posh closed to within three points of table-topping Hull.
Ferguson said: “Three points are all that matter at the moment and I’m delighted to get them.
“It was a scrappy game, I have to be honest, but we dug the result out.
“We tried to play as best we could, but the pitch made that difficult. It was more of a dogged performance from us, but sometimes they are the best wins.
“It’s probably an own goal, but we will give all the credit to young Harrison’s great delivery for the goal.
“We haven’t scored enough from set-pieces even though we work on them a lot, so it’s nice for one to come from a corner.
“Everyone knows our home form is very good. We have six more home games and most are against teams around us so they will all be big for us.
“We know we have to improve away, though, and we’ve got a big week coming up with Rochdale fighting for their lives and Blackpool, who beat us at our place.”
Caretaker Pompey boss Joe Gallen felt hard done by.
He said: “There is no way we deserved to lose and coming away from the game with nothing is really tough to take.
“We played with a lot of spirit and heart and also showed a lot of quality in the second half on an unbelievably tough pitch to play on.
“The ball just didn’t drop for us and I’m unbelievably disappointed with the goal we conceded. A corner that we would normally deal with pretty easily has ended up in the net.
“It just shows things aren’t going for us. The effort was there, the commitment was there and we put a Peterborough team with a strong home record under a lot of pressure – all after playing two hours of football in a cup final on Saturday.
“We can take a lot of belief and confidence going forward if we continue to play like that and that’s something I’ll do my best to make sure happens if I’m still around.”