PHOENIX — Nick Hundley hit a three-run homer, Johnny Cueto pitched well over six innings and the San Francisco Giants beat the resting Arizona Diamondbacks 9-2 on Monday night.

Arizona sat most of its regulars a day after clinching the top NL wild card.

Hunter Pence hit a solo shot in the Giants’ five-run fourth inning off starter Zack Godley (8-9). San Francisco has won five of its past seven games.

Cueto (8-8) held the Diamondbacks to two runs and five hits over six innings. He struck out eight and walked two.

The second of Jarrett Parker’s two doubles thumped off the left-field wall and drove in Buster Posey in the fourth, and Hundley crushed Godley’s offering off the facade of the second deck for his ninth home run. The Giants led the rest of the way.

Hundley drove in his fourth run of the game in the eighth with a single. The Giants scored three runs — two unearned — off reliever Jake Barrett in the inning, though Jeremy Hazelbaker took away a hit from Joe Panik with a diving catch along the right-field line.

A fielding error allowed Denard Span to score to increase the Giants’ lead to four in the top of the fifth. Godley was charged with five earned runs and eight hits. He struck out five with three walks.

Arizona was charged with four errors for the game.

The Diamondbacks fielded a lineup of reserves and recent call-ups, save for Drury and Godley. Manager Torey Lovullo said before the game that he would return to the regulars on Tuesday as the team looks ahead to hosting the NL wild-card game.

The entire team enthusiastically celebrated getting into the postseason late Sunday afternoon.

“Tomorrow we are going to crank it right back up, and it’s business as usual,” Lovullo said. “It’s going to be a dress rehearsal for the most important game of the year for us, and that’s going to be next Wednesday.”

NOTES

Lovullo said there’s a “50-50” chance he will change up the starting rotation over the course of the week as he lines up ace Zack Greinke to start the wild-card game. Greinke is scheduled to start Arizona’s home finale Wednesday against the Giants.

As for the bullpen, Lovullo plans for regular usage leading up to the wild-card game, with pitchers competing for a spot on the postseason roster.

The Diamondbacks coaching staff is preparing to face three teams in the wild-card game — Colorado, Milwaukee and St. Louis. All remain in contention for the second spot.

“I like that,” Lovullo said. “I don’t mind that at all. It keeps us on our game.”

The wild-card game sold out in an hour after tickets went on sale Monday morning.

Giants manager Bruce Bochy said right-hander Matt Cain, who was throwing in the bullpen before Monday’s game, could pitch once more this season, as could Cueto.