Charles N'Zogbia was goalscorer and provider as West Ham United's struggles on the road continued at Aston Villa on Sunday.
N'Zogbia won the second half penalty which Villa's top scorer Christian Benteke converted before curling a free kick into the Hammers net himself on 79 minutes.
Sam Allardyce's men were given hope by Ashley Westwood's late own goal, but the home side held on nervously through four minutes of stoppage time to haul themselves out of the bottom three.
Ultimately, the Hammers' hopes were undone in five second half minutes as they failed to make use of a strong start to the second period which pushed Villa back.
The visitors received a huge let-off with less than two minutes on the clock when Andreas Weimann somehow contrived to stroke the ball wide of the far post from inside the six yard box after Jussi Jaaskelainen spilled Christian Benteke's shot.
It was a huge miss and Andy Carroll wasn't far away from punishing the hosts when he gave an early glimpse of his aerial prowess to win a knock-down, and as the ball bounced back to him off a defender, the Hammers striker prodded a looping shot over the bar.
After Villa's fast start at Everton a week ago, Hammers boss Sam Allardyce knew his team needed to remain solid in the early exchanges, and he was forced into a defensive reshuffle when Joey O'Brien picked up a knock in the 24th minute and Guy Demel had to come on to replace him.
The home side were probing, but failing to find to make the most of their pace on the break and when Ciaran Clark was forced into defensive duties 10 minutes before the interval, he did well to divert Demel's teasing low cross into keeper Brad Guzan's arms with Carroll lurking behind him.
At the other end, Ron Vlaar volleyed into the ground and over after a corner came in from the right and West Ham would have been happy to go in at the break with the scoresheet blank.
They began the second period at a much better tempo and started to pin the visitors back with only an excellent interception from Clark preventing Mohamed Diame's low cross from resulting in a goal.
Kevin Nolan had a shot blocked after Guzan only just beat Carroll to a right wing cross from the right, but Villa went within a whisker of opening the scoring on 65 minutes when N'Zogbia burst clear down the right channel, cut inside to his left foot and drilled a shot inches past the far post.
The Hammers responded with a near miss of their own when Matthew Taylor's corner dropped for Carroll, and his low drive beat Guzan but not Darren Bent, who was in position to kick off the line.
The home side were clearly edgy in their play, but they were handed the perfect opportunity to ease their nerves 16 minutes from time when Mark Noble tripped N'Zogbia in the box and referee Mark Clattenburg pointed to the spot.
Benteke made no mistake, coolly sending Jaaskelainen the wrong way to give the home crowd the boost they craved.
It got worse for the Hammers five minutes later when N'Zogbia went from provider to goalscorer, curling a left footed free kick from 22 yards into the top right hand corner of Jaaskelainen's goal after Tomkins fouled Bent.
The home side's double strike left the Hammers stunned, but they set up a frenetic finale when Joe Cole swung over a cross from the right and Westwood flicked a header beyond his own goalkeeper.
West Ham had renewed hope, and with the home crowd becoming ever more desperate in their calls for the final whistle, Carlton Cole's last gasp header needed a save from Guzan.
But the equaliser would not come and the Hammers were left to rue another away day defeat.
Aston Villa: Guzan; Lowton, Vlaar, Clark, Baker; Bowery (Bent 64), Westwood, Delph; N'Zogbia (Sylla 85), Benteke, Weimann (Dawkins 64)
Subs: Given (GK), Holman, Bannan, Bennett
Goals: Benteke pen 74, N'Zogbia 79
Booked: Baker, Bent, Clark
West Ham United: Jaaskelainen; O'Brien (Demel 24), Reid, Tomkins, Pogatetz, Taylor (Vaz Te 67); J.Cole, Diame, Nolan, Noble (C.Cole 76); Carroll
Subs: Spiegel (GK), Jarvis, Chamakh, O'Neil
Goal: Westwood og 87
Booked: Pogatetz, Reid
Referee: Mark Clattenburg