SAN FRANCISCO -- In a pitching battle that lived up to the hype, Zack Greinke got the better of Madison Bumgarner as the D-backs continued their dominance at AT&T Park with a 2-1 win over the Giants on Wednesday. Arizona has now won nine of 10 and 11 of its last 13 games here and four straight overall.
"I didn't really think about that too much," Greinke said about the matchup with Bumgarner. "I just was trying to make as good of pitches as possible. The team has been playing good and just trying to continue the sort of roll we're on right now."
Greinke and Bumgarner traded zeros through the first six innings before Welington Castillo broke the game open with a two-run homer in the top of the seventh. Yasmany Tomas led off the inning with a single to center and Bumgarner had Castillo down 0-2 before leaving a fastball up and out over the plate that Castillo was able to hit over the wall in left-center.
"I felt pretty good about the pitch I made to Castillo," Bumgarner said. "I was more upset about the pitch before that that put Tomas on. I was going back-door cutter and it ran back all the way across the plate."
The Giants cut the lead in half -- and chased Greinke from the game -- in the bottom of the inning when Gregor Blanco tripled with one out and scored on Angel Pagan's single to left.
MOMENTS THAT MATTERED Big hit: After providing plenty of power last year following his trade to Arizona from Seattle, Castillo had been quiet in 2016. He entered Wednesday night's game hitting .209, but he rediscovered his clutch ways with his seventh-inning homer.
"Both pitchers were spot on," D-backs manager Chip Hale said. "It took one pitch that Bumgarner left in the zone for us to hit, and Welington did a nice job. For a while there, I'm thinking, 'Boy are we going to go 20 innings tonight?'"
Stranded: The Giants had Greinke on the ropes early when the first two batters in the first inning reached base, with the heart of the order coming up. But Greinke got Buster Posey to fly out before Brandon Belt and Brandon Crawford struck out swinging. San Francisco also came up empty after getting a runner to third with less than two outs in the third, fourth and ninth.
Big battle: With one out and Blanco on third in the seventh inning, the Giants elected to pinch-hit Hunter Pence. Greinke quickly got ahead 0-2, but Pence battled him for nine pitches before popping up to first baseman Paul Goldschmidt. The at-bat may have taken its toll on Greinke as Pagan followed with an RBI single.
"He's so scary, he can hit a pitch at his shoe tops or over his head and hit it a long way," Hale said of Pence. "Zack, I think, was enjoying it. If you looked at him out there, he was having fun. He enjoys those matchups. That's why he's the ace that he is. He won that matchup, but of course Pagan comes in and gets the big base hit to bring it to 2-1. That's why when we come here to play this team, we know you're never going to have an easy out."
Getting through seven: Even though he lost to fall to 1-2, Bumgarner pitched into the seventh inning for the first time this season and matched his season high of eight strikeouts.
"I was just trying to make pitches and slow everything down," Bumgarner said. "I still don't feel like I'm where I want to be but it was definitely better, for sure."
WHAT'S NEXT D-backs:Shelby Miller starts for the D-backs on Thursday afternoon in the series finale with the Giants, which starts at 12:45 p.m. MST. Miller's last outing lasted just 1 2/3 innings after he banged his right hand on the pitcher's mound twice during Andrew Cashner's at-bat and was forced to leave the game..
Giants: Right-hander Johnny Cueto pitches the series finale against Arizona at AT&T Park on Thursday at 12:45 p.m. PT. Cueto is attempting to become the first San Francisco pitcher to win his first four starts since Bill Swift did it in 1992.
Steve Gilbert is a reporter for MLB.com. Follow him on Twitter @SteveGilbertMLB. Mike Wagaman is a contributor to MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.