The Villains were able to shift up to 17th on the table thanks to Christian Benteke's 74th-minute penalty and Charles N'Zogbia's brilliant free-kick four minutes later before Ashley Westwood's own-goal in the 87th minute gave the Hammers some hope.
However, Villa held on for a vital lot of three points and Lambert was grateful to his players for producing what was required to ease the tension for another week.
"It's only great when you hear that whistle and you've won. It's the only good thing about it. The stress levels are ridiculous," said Lambert to Sky Sports.
"It's hard to explain. You have to be in that position. Balls are going into your box. But once it's finished it's great you have won. You just have to see it through.
"It's a huge win for us. We have been in positions of being goals up in a right few games.
"If we had taken more points from those, we'd be comfortably in mid-table. But the pleasing thing is we have hopefully broken the camel's back with that."