Both teams had chances to win the game but it took until the 74th minute for either side to score.
Mark Noble clearly fouled Charles N’Zogbia inside the penalty area and in-form striker Christian Benteke slotted home the resulting spot-kick.
N’Zogbia then thumped a beautiful free-kick from 25-yards passed Jussi Jaaskelainen to give the Villains the cushion they needed.
The Hammers then got a consolation goal on 87 minutes as a Joe Cole cross hit a Villa defender and looped into the net. Despite a final push to try and rescue a point, the Hammers could not find another way past Villa and the game finished 2-1.