Updated

Shutting down Arizona's best pitcher isn't on Diamondbacks manager Kirk Gibson's.

"Those guys want to pitch," Gibson said after rookie left-hander Wade Miley threw 116 pitches over seven innings in the Diamondbacks' 3-2 loss to San Francisco on Saturday night. "You get 200 innings, it is quite a bench mark. It's a different territory."

Miley (15-10) reached the 116-pitch plateau for the third time this season on the same night he ran his season innings total to 177, just above last season's 169 2-3 innings with four starts to go.

"Everybody says just shut him down but what if he has to go 230 next year, or 240," Gibson said. "He has prepared his whole life to become a major leaguer. This has been his dream. He has worked his way to being a starter for us.

"He has been as consistent a pitcher for us as anyone on our staff and we don't see any things right now that would lead to (shutting him down)."

Miley allowed three runs on eight hits, walking one and striking out four.

Two of the runs came in the fifth, when Buster Posey hit a two-run home run to break a 1-all tie. The All-Star catcher is hitting .390 in 55 games since the break with 12 homers and 49 RBIs.

"I made a bad pitch to Posey and he capitalized on it," Miley said. "He is a pretty good hitter and he does what you're supposed to do with that pitch. I tried to get a sinker down and off the plate. I was trying to get him to chase something off the plate."

The Diamondbacks cut the lead to 3-2 in the bottom of the eighth. Aaron Hill walked, went to second on a ground out and scored on Paul Goldschmidt's single off Romo, the Giants' third pitcher of the inning.

"We didn't have many (chances)," Gibson said. "We had a couple of chances with runners in scoring position and we scored only four runs in two nights."

Barry Zito scattered six hits and one run over 6 2-3 innings for the Giants, who have won four straight and 22 of their past 32. Zito (12-8) walked one and struck out four. Sergio Romo pitched the final 1 1-3 for his 11th save.

Zito's outing was his longest since an eight-inning stint on August 23. He gave way to Santiago Casilla after surrendering a two-out ground rule double to left by John McDonald.

The Giants are unbeaten in Zito's last eight starts.

"It's great to be out there and have a part of a win no matter how we get it," Zito said. "It's not about individual stats, it's about the team stats. My body feels good right now and I'm thankful for that."

Justin Upton hit his 14th home run for the Diamondbacks, who have scored four runs or fewer in 12 straight home games to match a franchise record.

"They are shutting us down," Gibson said. "This is the fourth time they have won this year when he's pitching against us. You'd like to think you could make an adjustment and beat him tonight."

San Francisco took a 1-0 lead two batters into the game when Angel Pagan tripled off the wall in left-center field and scored on a grounder to short by Marco Scutaro.

Upton tied the game in the bottom of the fourth with a solo shot to left-center field, his first homer in eight days and only his fifth against left-handed pitching this season.

Miley pitched into trouble in the fourth, loading the bases with a two-out walk to Hunter Pence, but retired Joaquin Arias on a fly ball to right to end the inning.

NOTES: Miley threw 116 pitches, the third time he has reached that mark this season. In both previous games, he earned the victory. ... Pagan's first-inning triple was his 13th of the season, a new San Francisco Giants' record. Willie Mays holds the franchise's overall mark with 20 triples in 1957. "Willie Mays is one of the best players to step on a baseball field," he said. "To be next to that name it very special." ... Goldschmidt was caught stealing in the fourth for only the third time in 19 attempts. ... Arizona OF Tyler Graham made his major league debut in the ninth when he pinch ran for Miguel Montero. Two pitches later, Hector Sanchez threw him out trying to steal second with a throw from his knees. ... The Diamondbacks opened the retractable roof mid-game for the second time this season and first since a May 13 contest against the Giants. ... RHP Ryan Vogelsong (12-8) will take the mound for the Giants in Sunday's series finale against Diamondbacks LHP Patrick Corbin (5-7). Vogelsong is 2-3 in his past six starts and has allowed 28 runs on 43 hits in 26 1-3 innings with a 9.57 ERA. Corbin also has struggled of late, posting a 0-3 record and 6.00 ERA in his past four starts. ... The Diamondbacks staged their first-ever alumni contest after the game.