Louis Saha gave Everton a first half lead and Gosling claimed his first League goal since April in the 64th minute. Junior Stanislas replied for West Ham a minute later and then the home side squandered a succession of late chances.
Related ArticlesPremier League tablePremier LeaguePremier League fixturesTelegraph player raterSport on televisionThe absence of Carlton Cole, who had scored six of West Ham's 15 goals before this game, meant that Zavon Hines, who scored the late winner against Aston Villa last Wednesday, was given only his fourth League start of the season.
And while the 20-year-old Jamaican-born England Under-21 international worked hard, he struggled to get the better of Joseph Yobo and Sylvain Distin.
Guillermo Franco headed narrowly wide for West Ham and then Scott Parker forced Tim Howard to save. West Ham's early approach work was busy but they struggled to match it in attack and when Everton got a rare chance they punished the home side.
In the 27th minute, Matthew Upson's failure to clear allowed Tim Cahill to feed the ball inside and Louis Saha finished well, finding the bottom left hand corner for his ninth goal of the season and fifth in three games against West Ham.
Before the break Luis Jiménez's free-kick was deflected high and held by Howard as West Ham laboured to equalise.
At half-time West Ham brought on Junior Stanislas, their second leading score, for Jack Collison and his first act was to win a corner. Stanislas took it, returned passes with Parker, then presented Franco with a headed chance he wasted.
And when Manuel Da Costa delivered a superb ball into the area, Franco appeared to be impeded as he tried to reach the delivery.
Both teams made changes before the hour mark when West Ham's Alessandro Diamanti came on for Luis Jiménez while goalscorer Saha, who had been troubled by a virus, was replaced by Aiyegbeni Yakubu.
Still West Ham pushed and Stanislas was unfortunate with an effort that curled the wrong side of the left post.
But in the 64th minute Everton doubled their lead. Yakubu's pass found Gosling unmarked and after Robert Green saved his first shot the midfielder responded by finding he net.
However, a minute later West ham responded when a lofted pass fell to Stanislas, whose lobbed effort rose over Howard and Tony Hibbert, who could have cleared off the line, succeeded only in placing the ball in the roof of the net.
Diamanti came close to an equaliser when he sent a delightful left-footed attempt narrowly over. And when Hines was put through by Parker, he shot wide when he should have scored.
Hines broke clear again but was halted by Yobo, who avoided a red card because of the covering Distin, and Everton held on to claim only their second away win of the season.