The breakthrough came after 25 minutes when Kyle Walker cut the ball back from the byline for Gabriel Jesus to deftly flick in.
Kevin De Bruyne was a growing influence for City, and his penetrating run and pass set up Sterling to make it 2-0 six minutes after half-time.
Jesus thought he had scored a third for City, only for his goal to be disallowed after Sterling was adjudged to be offside in the build-up, making it the first decision to be overturned by a Video Assistant Referee in the Premier League.
But Pep Guardiola’s side carried on regardless, making it 3-0 with 15 minutes remaining as Sterling chipped Fabianski.
Substitute Sergio Aguero added a fourth with a penalty after his first spot-kick was saved by Lukasz Fabianski but he was able to retake it due to encroachment.
Sterling then had the final say, beating Fabianski to score the first PL hat-trick on opening weekend since Didier Drogba for Chelsea in 2010.
West Ham: 17 Aug v Brighton (A)
Man City: 17 Aug v Spurs (H)
Referee: Mike Dean; Assistants: Darren Cann, Dan Robathan; Fourth official: Gavin Ward; VAR: David Coote; Assistant VAR: Stephen Child