The Hammers would have been hoping for as comfortable a 90 minutes as possible with home advantage in the first leg of the Europa Conference League semi-final tie, but instead fell behind in the first-half as Tijjani Reijnders’s strike from distance found a way past Alphonse Areola.
A response came from West Ham though after the break, as they turned to a more direct style and proved too powerful for AZ. Said Benrahma converted from the penalty spot after Jarrod Bowen was clattered into by Mat Ryan, before Michail Antonio completed the comeback ten minutes later.
It leaves West Ham with a slender advantage heading to the Netherlands next week, when the West Ham boss will want his side to produce a more composed display.
“We were a bit harum-scarum,” Moyes told BT Sport.
“We made some stupid decisions, shooting from 30 yards at time and missing some big opportunities. But in the end, I’m happy with the result.”
There was particular frustration both on the pitch and in the stands for AZ’s goal, with West Ham convinced Lucas Paqueta had been shoved in the build-up, but play was waved on and VAR did not intervene.
Twelve months ago the Hammers were also bemoaning the officiating in a European semi-final, after Aaron Cresswell was sent-off in the second leg of the Europa League tie with Eintracht Frankfurt as Moyes’ side were knocked out, but this time they were able to rally and keep their heads.
“Everybody in the stadium I think felt it was a tough night,” Moyes said.
“One of the questions was what have we learnt from last year - one of the things was not to get involved with the referees or get too caught up in it. It’s very difficult when you think things are going slightly against you.”
He added: “Their goal and a few of the referee decisions were hard to take in the stadium. But overall, the goal got us back in the thick of it. We were the team who were probing and trying to score more than they were.”
Asked whether West Ham now had a foot in the final, Moyes was quick to shut down any suggestion that his side were in a comfortable position.
“No, I wouldn’t say that,” he responded. “I’m too humble for that, and understand that there’s another club who will be sitting listening to every word I say. No chance.”