Portsmouth's Erik Huseklepp scored an own goal in the dying seconds to gift Peterborough their first away win of the season.
The visitors led twice following a brace from Lee Frecklington but it seemed as though Benjani had rescued a point for Portsmouth.
Frecklington's first goal was cancelled out by a Gabriel Zakuani own goal.
But Ryan Tunnicliffe saw his low shot go in off Huseklepp to give Posh the win.
Frecklington broke the deadlock in the fourth minute when goalkeeper Jamie Ashdown could only turn his shot onto the underside of the crossbar before it dropped over the line.
Portsmouth levelled when Huseklepp drilled a dangerous angled shot across the box and Zakuani volleyed his attempted clearance past goalkeeper Paul Jones.
Frecklington then lashed the ball into the top corner for his second of the evening.
Huseklepp was again the architect with another low ball across the box which Benjani prodded home for his first Portsmouth goal since 2008.
But Peterborough snatched a victory at the end when substitute Tunnicliffe raced clear and Huseklepp slid in to divert his shot past the hapless Ashdown.