A rare headed double in the first half by Linvoy Primus inflicted new West Ham boss Alan Curbishley's first defeat.
Primus's most recent goal came on Boxing Day two years ago
Pedro Mendes set up both with a corner and free-kick from the left, allowing Primus time and space to head home.
Substitutes Carlos Tevez and Teddy Sheringham gave West Ham more threat, with Tevez nearly scoring before Sheringham pulled one back late on.
David James fumbled Sol Campbell's clearance out to Sheringham, who lobbed into the net from a tight angle.
The home side had the better of the opening exchanges without seriously threatening to score but when the momentum began to go Portsmouth's way, they quickly took advantage.
606 DEBATE: Your reaction to Portsmouth's win
As the ball came in from Mendes' corner on the left, Primus shrugged off Marlon Harewood's feeble challenge to connect with a downward header, which bounced up into the roof of the net.
Sol Campbell wasted a great chance to make it 2-0 when he scooped over from close range after Sean Davis' shot was cleared off the line by Hayden Mullins.
Mendes came within inches of doubling the lead when he flashed a shot inches over the bar as West Ham showed no sign of snapping out of their lethargic mood.
On 35 minutes Yossi Benayoun's solo run and deflected shot gave the home fans something to get excited about but it was a subdued and somewhat passionless first-half display.
Primus' opening goal was his first in two years but he did not have to wait long for the second as once again Mendes crossed from the left after a Jonathan Spector handball and Primus brushed aside Mullins to head home his second.
The half-time introduction of Sheringham and Tevez for Harewood and Matthew Etherington certainly lifted West Ham but did not result in any immediate change to the scoreline.
Twice in quick succession Tevez came close to breaking his West Ham duck, flashing a shot across the front of the goal and putting a curling free-kick inches over the bar.
West Ham's pressure eventually told when keeper David James could only fumble Campbell's attempted clearance wide, as far as Sheringham, who lifted the ball in from a tight angle.
This prompted a late West Ham rally but, for all their late threat, the home side could not find a way through to James' goal and, ultimately, they paid the price for their sloppy first-half defending.
West Ham manager Alan Curbishley:
"You can't set about games like we did in the first half and expect to get things.
"I had no illusions when I came in, it's going to be a tough run-in and we've got to be confident enough that we'll get out of it.
"The Premiership is an unforgiving league - you have to be full-on and defend properly every game - in the last two games they did, but I was a bit shocked by today."
Portsmouth coach Joe Jordan:
"I don't think we got complacent, it was just down to West Ham's desire to get something from the game.
"If we had got a third goal it would have killed the game but the game was never dead.
"West Ham are desperate for points and this is never an easy place to come but I thought we deserved the win."
West Ham: Green, Spector (Dailly 69), Ferdinand, Gabbidon, Konchesky, Benayoun, Reo-Coker, Mullins, Etherington (Tevez 46), Zamora, Harewood (Sheringham 46).
Subs Not Used: Carroll, McCartney.
Booked: Ferdinand, Reo-Coker.
Goals: Sheringham 81.
Portsmouth: James, Johnson, Primus, Campbell, Pamarot, O'Neil, Davis, Pedro Mendes, Taylor, Fernandes, Kanu (Cole 87).
Subs Not Used: Ashdown, O'Brien, Thompson, Kranjcar.
Goals: Primus 16, 38.
Ref: M Atkinson (W Yorkshire).