West Ham then doubled their lead in the 63rd minute through Arnautovic, who shrugged off Michael Keane, turned towards goal then rifled into the back of the net from 25 yards.
Although Niasse halved the deficit on 75 minutes with a close-range finish following a scramble from a corner, David Moyes's side restored their advantage seven minutes from time, Lanzini getting the better of Seamus Coleman and curling home.
The final whistle saw West Ham secure a 13th-placed finish in the Premier League table, while Everton end their campaign eighth in the standings.
WEST HAM UNITED (4-3-2-1): Adrian; Rice, Ogbonna, Cresswell, Zabaleta; Kouyate, Noble, Masuaku (Fernandes 21'); Mario, Lanzini (Obiang 86'); Arnautovic
EVERTON (4-2-3-1): Pickford; Keane, Jagielka, Funes Mori (Klaassen 45'), Baines; Schneiderlin, Coleman; Davies (Bolasie 83'), Gueye, Tosun (Walcott 61'); Niassebody check tags ::