It was the Hammers' first win of the EPL campaign and also ended the Terriers' unbeaten start to the season.
Ayew, on as a second-half substitute, added a second goal in the 77th when he poked home a loose ball from inside the six-yard box from a corner.
West Ham dominated the first half but could not find a breakthrough despite the likes of Javier "Chicharito" Hernandez looking unsafe.
The win brought the Hammers their first points of the season after they lost their opening three matches this season.
Dimitri Payet left West Ham last January, after going on striker in order to return to Marseille, in a deal which was eventually worth £26m.
Michael Ball suggests Alex Oxlade-Chamberlain is deluded
Henderson said, as quoted by the Mirror : "Well, I think, you'd have seen him [Klopp] on the sidelines, he's very passionate". Oxlade-Chamberlain signed for Liverpool on deadline day and now Arsene Wenger has spoken about the deal for the first time.
Andy Carroll won 13 aerial duels in the game, the most of any player in a Premier League game this season. "We've played at home - won - and now we go to West Brom which will be a very hard place to go".
"He deserved this because he has been under a lot of pressure of course as we all know". Bilic, who's 49th birthday coincided with his side's victory, looked visibly relieved at the end of the game.
With club record signing Marko Arnautovic still suspended after his red card against Southampton last month, United manager Slaven Bilic has opted for a change in formation to accommodate his front two. We were good in seconds and defended their set pieces ok.
"It worked well past year when we changed to this system".
"We weren't fearless enough, confident enough, we made so many unforced errors, so many poor decisions". I am sure you will see a different West Ham getting those first three points.