An expertly taken free kick from the Frenchman and a Christian Benteke penalty earned the home side three crucial points in their battle for Premier League survival
In an uninspiring contest, Benteke's penalty and N'Zogbia's wonderful free kick were enough for Villa to secure a first league win since beating Liverpool in December, although they needed to overcome some nervy moments in the closing stages after a late own-goal by Ashley Westwood.
Paul Lambert made three changes from the side that drew 3-3 with Everton last time out, with Jordan Bowery handed a first league start for the Villians and Fabian Delph and Nathan Baker recalled. Emanuel Pogatetz made a first start for West Ham, with Joe Cole also coming into Sam Allardyce's starting XI.
The first half was a turgid affair, with neither side capable of creating any clear-cut opportunities. The hosts, however, will have been disappointed to go into the break level after registering a contender of miss of the season with their only real chance of the half.
It came after just two minutes when a powerful shot from Belgium striker Benteke was spilled by Hammers keeper Jussi Jaaskelainen straight into the path of Andreas Weimann, but from the edge of the six-yard box the young striker could only place his shot wide of the far post with the entire goal gaping.
Villa arguably shaded the opening period, but a Ron Vlaar half-volley from a corner aside, they did not threaten Jaaskelainen thereafter.
The visitors fared little better, with Mohamed Diame's sliced shot which went well wide of the near post midway through the half their best contribution to the game.
They started the second with much more purpose, though, and had a good claim for a penalty turned down when Vlaar tussled with Andy Carroll. Referee Mark Clattenburg had an excellent view of the incident, but decided it was not worthy of a spot kick despite strong appeals from the visitors.
West Ham continued to be the superior side as the game reached the hour mark, with Matt Taylor and Joe Cole causing several problems for the Villa defence with their crosses from wide positions.
The home side almost grabbed a goal against the run of play when N'Zogbia's left-footed effort went narrowly wide of the far post after he cut in from the right but seconds later, Carroll had a powerful drive cleared off the line after he reacted quickest to a goalmouth scramble following a corner.
The first goal arrived in the 73rd minute after a clumsy foul by Mark Noble on the quick-footed N'Zogbia in the area gave Benteke the chance to open the scoring from the spot, and he did so with supreme calm by coolly passing the ball into the bottom corner.
Five minutes later, the points were in the bag for Villa as N'Zogbia curled home a wonderful free kick from 25 yards out. His left-footed effort beat the four man wall and was too good for Jaaskelainen as it nestled in the corner of the net.
West Ham grabbed a late consolation when Westwood accidently flicked Joe Cole's cross past goalkeeper Brad Guzan, but the home side held on to earn a vital win.