West Ham started brightly in East London as they kept City on the back foot during the early stages of the game, although it did not take long for City to find their rhythm at the other end of the pitch.
After gradually upping the tempo, City went in front after 25 minutes. Kyle Walker was released down the right flank and after reaching the byline, the full-back pulled the ball for Jesus to convert from six yards out after reacting sharply to a deflection from Issa Diop.
West Ham attempted to respond at the other end, although there were indications that the Hammers were already tiring after a high-octane opening to the contest.
However, while Kevin De Bruyne forced another decent stop out of Fabianski having got a shot away from 18 yards, West Ham made it to the break without any further alarm.
De Bruyne burst forward through the centre of the pitch before laying the ball to his left for Sterling, who took his time before sliding a low shot inside the near post from 10 yards.
City thought they had netted a third moments later, with Jesus ending a superb team move with a tap-in from close range, but VAR ruled that Sterling had been in an offside position earlier in the attack.
That reprieve led to a positive response from West Ham, but Diop failed to take advantage when the opportunity arose as he sent a header from six yards over the crossbar.
However, City quickly went about confirming maximum points by netting a third, with Sterling lobbing Fabianski from inside the area after collecting a precise floated pass from Mahrez.
City's fourth came via a re-taken penalty, with Aguero eventually converting from 12 yards after Fabianski had saved his first effort, which was chalked off as a result of encroachment by two West Ham players.
Sterling had been left disappointed having been denied the chance to complete his treble from the spot, although the winger claimed the match ball in added-on time as he coolly slotted the ball inside the near post after another excellent pass from Mahrez.
While the final result was harsh on a West Ham side who were full of endeavour, City were successful in laying down a marker to their rivals, who may have been hoping that the Hammers could do them a favour on the opening weekend.
WEST HAM UNITED (4-2-3-1): Fabianski; Fredericks, Balbuena, Diop, Cresswell; Rice, Wilshere (Snodgrass 56'); Antonio (Fornals 46'), Lanzini, Anderson (Hernandez 66'); Haller
MANCHESTER CITY (4-3-3): Ederson; Walker, Stones, Laporte, Zinchenko; Rodri, De Bruyne (Gundogan 79'), D.Silva (Foden 80'); Mahrez, Sterling, Jesus (Aguero 69') body check tags ::