Callum Wilson came off the bench to score in stoppage time as West Ham beat Everton 2-1 to stay out of the Premier League relegation zone.