The Hammers had taken the lead inside two minutes with a strike from Robbie Keane but Villa wrestled back control with Darren Bent's header shortly before the interval.
West Ham goalkeeper Robert Green pulled off a string of top-class saves to keep his side in the game but Villa snatched a deserved victory with a header from substitute Gabriel Agbonlahor in added time.
Villa's victory moved them up to ninth in the table on 40 points, seven clear of the drop zone, while defeat edged West Ham closer to relegation.
"I must give credit to their character because that is what we need when we are in a fight against relegation, you need character and you need composure," said Houllier.
"At times we demonstrated well that in difficulties the team was together and working well."
Source: PA
Source: PA