Pablo Zabaleta was West Ham’s unlikely hero as the substitute’s second-half goal saw off a spirited Gillingham side to record a second successive victory for David Moyes since his return.

The Argentina defender was part of the Manchester City team in 2011 that ended a trophy drought that had lasted more than three decades before being sent off in the shock 2013 FA Cup final defeat by Wigan so it is fair to say the 34-year-old has seen both sides of this famous competition.

Curtis Jones curler settles Merseyside derby as Liverpool edge out Everton Read more

After an uncomfortable evening against opponents who were 39 places below them in the league pyramid, it was Zabaleta who settled West Ham’s nerves 16 minutes from time before his fellow substitute Pablo Fornals added a second in injury-time.

“We played with the respect the competition deserves,” said Zabaleta. “We take it very seriously, which is why I’m so pleased with the team.”

His manager clearly concurred, even mentioning that this season marks the 40th anniversary of West Ham’s last FA Cup triumph. “I’ve been in one final before and I would love to get to another one,” Moyes said. “We know the supporters would love to have a cup run but the Premier League is always at the forefront of our minds.”

The seriousness with which he is treating this competition was illustrated by making only three changes from the side that beat Bournemouth 4-0 in his first match since replacing Manuel Pellegrini. Issa Diop’s return meant a switch to a three-man defence as their manager returned to a formation that served him well during his first spell in charge.

The Gillingham manager, Steve Evans, grew up playing for Celtic Boys Club alongside Moyes and had kept in touch with his former team-mate as the pair have racked up the years in management. The 57-year-old’s appointment at the end of last season means he has managed almost 1,000 games in English football, having previously guided non-league Crawley Town to the fifth round of the competition in 2010 when they were beaten by Manchester United.

With his side unbeaten in seven matches in all competitions, Evans would have fancied his chances of causing another upset against opponents who were knocked out by AFC Wimbledon last season under Pellegrini and Wigan in 2018 under Moyes.

Facebook Twitter Pinterest Lukasz Fabianski makes a rare save on the night. Photograph: Ben Stansall/AFP via Getty Images

West Ham dominated possession in the first half but still found themselves under concerted pressure from their all-action hosts, with Tom O’Connor warming Lukasz Fabianski’s gloves in the 18th minute after a series of corners.

Felipe Anderson ended his 22-game goal drought against Bournemouth but the Brazilian was largely anonymous as the visitors struggled to find their rhythm in attack.

A suspected hamstring injury to Ryan Fredericks just before half-time led to Zabaleta replacing him, with Sebastian Haller correctly having a goal ruled out for a foul in the buildup.

Gillingham, looking to reach the fourth round again having knocked out Cardiff at this stage last season, sensed the chance of another Premier League scalp in front of a packed stadium.

Moyes clearly was not impressed with his side’s first-half performance and West Ham could have made amends for their slow start immediately after the restart when a clever ball from Anderson set up Haller, only for the Frenchman to balloon his shot well over the bar.

Just a minute: why mental health is worth delaying FA Cup ties for | Barry Glendenning Read more

Another effort that smacked off Jack Bonham’s near post with the keeper beaten gave more encouragement to the pocket of away supporters in the temporary stand behind the goal.

A blatant tug on Declan Rice’s shirt by O’Connor following a free kick from Robert Snodgrass somehow went unpunished by Andrew Madley but in the absence of VAR, no penalty was awarded.

Moyes threw on Fornals in the hope of inspiring something from his side but it was Anderson who finally provided it, even if the goalscorer’s identity was rather unexpected. A quick one-two between the Brazilian and Arthur Masuaku allowed the full-back to pick out Zabaleta at the far post and his shot squeezed past Bonham.

Zabaleta was perhaps lucky to escape with a yellow card after going down easily in the penalty area and then arguing with Madley.

The closest Gillingham came to forcing a replay was when Stuart O’Keefe let fly from long range before Fornals gave the scoreline a more generous hue.