Wenger announced on Friday that he would be bringing his 22-year reign at the Emirates to an end in the summer, leading to calls for his players to ensure he end his remarkable tenure on a high.
His players reacted perfectly as they secured three points on home turf, though the game was much tighter than the scoreline suggested for long periods.
West Ham were the better side early on, going close when Marko Arnautovic stole in ahead of Shkodran Mustafi to run clear, but David Ospina parried his effort to safety.
The visitors hit the bar minutes later as Cheikhou Kouyate met a corner from the left, though it was more down to luck than judgement.
Arsenal responded though, gradually claiming more and more of the ball as Danny Welbeck and Hector Bellerin both missed the target from the edge of the box.
Welbeck could have opened the scoring 10 minutes before the break as he met Bellerin's cross from the right but he got up too early and failed to make convincing contact.
With that the two sides went in level, but there was a rollercoaster second period in store.
- Goal-filled second half -
Just six minutes after the restart, the hosts found the breakthrough as Nacho Monreal volleyed home Granit Xhaka's corner from the left first time from the penalty spot.
22 April 2018
That strike appeared to be just what the home side needed, but West Ham responded admirably as they piled on the pressure.
Arnautovic volleyed over on the turn, before going one better a minute later as he smashed a low strike across Ospina and into the far corner to level the scores after being fed by substitute Maneul Lanzini.
- Late blitz -
Not to be denied though Arsenal only came back stronger, with Joe Hart twice making fine saves to deny Xhaka and Welbeck away to his left.
Pierre-Emerick Aubameyang was summoned from the bench and with him came an avelanche of goals as the hosts scored three times in a seven-minute spell.
When Arsenal's second came eight minutes from time it was mainly West Ham's own doing. There looked to be little danger out on the left as Aaron Ramsey looked to cross but young Declan Rice inexplicably ducked below his ball in, leaving Hart wrong-foooted and a mere spectator as the delivery nestled in the far corner.
Just three minutes later Alexandre Lacazette got in on the act, powering past Hart from a narrow angle with the help of a slight touch off Aaron Cresswell.
Finall, with just a minute of normal time to go Lacazette rounded the scoreline off with his second of the day, allowing the ball to run across him after fine work from Ramsey down the left before beating Hart low to his left.
The result moves Arsenal six points behind Chelsea in fifth and four ahead of Burnley in seventh having played a game fewer, as the 'Gunners' now turn their attentions to the Europa League semi-final clash with Atletico Madrid in midweek.
West Ham, meanwhile, remain 15th, just six points clear of the relegation zone.
22 April 2018