The Hammers registered their third away win in a row in the 2015-16 Premier League campaign, as they got the better of City 2-1 at the Etihad Stadium.
Chelsea-owned winger Victor Moses put West Ham ahead after just six minutes, and Diafra Sakho doubled the advantage just past the half-hour mark.
Kevin De Bruyne fired home for City on the stroke of half time, but the hosts failed to find an equaliser in the second half.
Former Newcastle striker Shearer was impressed with West Ham’s victory and gave his reaction on Twitter.
The Englishman also made a joke about the London club not getting rid of Sam Allardyce sooner.
#WHUFC first team in 10 years to beat Arsenal, Liverpool & Man City away in a season. Can't believe they didn't get rid of Sam sooner— Alan Shearer (@alanshearer) September 19, 2015
Allardyce was in charge of West Ham for four years from 2011 to 2015, but he was never quite popular with the fans.
The former Newcastle United manager’s contract with the Hammers ran out at the end of last season, but it was not renewed.
Slaven Bilic succeeded Allardyce at the Boleyn Ground at the start of the season, and West Ham have already defeated Arsenal, Liverpool and City away from home.