PHOENIX — The Giants flew to Arizona having scored eight runs in their previous five games. They were facing a pitcher, Zack Greinke, who was undefeated in 11 previous starts against them.
Baseball is a funny game.
The lineup broke through with two mid-game rallies, Johnny Cueto had another very strong start, and the bullpen just barely held on in a 4-2 win over the Diamondbacks.
Greinke was 8-0 all-time against the Giants, and his team had lost just once. His previous highs were seven hits and three earned runs allowed, but the Giants bested both those figures.
They had eight hits, including four singles in a two-run fourth inning. Denard Span led off the fifth with his second hit and Joe Panik blasted a first-pitch fastball deep to right for his fourth homer of the season. Greinke was pulled after the sixth, his ERA sitting at an ugly 5.26.
The Diamondbacks briefly flirted with Cueto in the offseason before going all-in on Greinke, who likely would have ended up with the Giants had Arizona not swooped in at the last second. So far that exchange has worked out well for the Giants, who got seven innings and 115 pitches out of their new No. 2.
Cueto gave up a run in the first and one in the sixth, but he finished on a high note, striking out Paul Goldschmidt for the third time.
A day after giving up a game-tying homer, Santiago Casilla allowed a pair of hits with one out in the ninth and the Giants holding a two-run lead. He struck out Brandon Drury, but walked Paul Goldschmidt to load the bases.
Bruce Bochy had seen enough, and he pulled a livid Casilla in favor of left-hander Javier Lopez, who got Jake Lamb to ground out.
Starting pitching report: Cueto had eight strikeouts for the fourth time in eight starts. He has 52 for the season, putting him seventh in the National League. Madison Bumgarner is third and Jeff Samardzija is 13th.
Bullpen report: Cory Gearrin had a nice bounce back outing, retiring all three batters he faced with a runner on in the eighth.
At the plate: The Diamondbacks probably did the Giants a favor by pinch-hitting for Greinke in the sixth. With two outs and a runner on second, Rickie Weeks Jr. hit for Greinke, who is batting .333 and smoked the ball in his two at-bats. Cueto walked Weeks Jr., then struck out the No. 9 hitter, .176-hitting shortstop Nick Ahmed, on three pitches.
In the field: Buster Posey gunned Jean Segura down in the fifth and has caught nine of 17 runners who have tried to steal on him this year. His previous career-high was 37 percent.
Attendance: The Diamondbacks announced a crowd of 19,461 human beings who made fewer jokes because the players wore sweet throwback jerseys.
Up next: Jeff Samardzija faces Shelby Miller in a matchup of two very different offseason acquisitions. Samardzija is 4-2 with a 3.17 ERA; Miller is 1-3 with a 7.36 ERA.