Paul Goldschmidt homered and Ian Kennedy won for the first time since April 22 as the visiting Arizona Diamondbacks avoided a three-game sweep at the hands of the Giants with a 4-1 victory Wednesday.
Kennedy (4-5) won his fifth straight start against the Giants while allowing one run over 7²⁄³ innings on a career-high 122 pitches. David Hernandez worked around a leadoff single in the ninth for his first save.
Goldschmidt broke a 1-1 tie with his two-out homer in the sixth off Tim Lincecum (2-6), who gave up two runs (one earned) on four hits with five walks and six strikeouts over seven innings.
Lincecum lost his fifth straight start to the Diamondbacks, who grabbed an early lead in the second when Miguel Montero scored on Ryan Roberts’ sacrifice fly.
San Francisco tied the game when Gregor Blanco tripled to lead off the fourth inning and scored on Ryan Theriot’s single.
Arizona, which snapped a four-game losing streak to the Giants, extended its lead in the eighth when Goldschmidt and Roberts singled in runs off Steve Edlefsen.
Melky Cabrera singled in the eighth inning and tied Randy Winn for the most hits in a calendar month in San Francisco-era history with 51. On Tuesday, Cabrera matched Willie Mays for the most hits in the month of May in Giants history at 50.
NOTES: Goldschmidt is 7-for-12 with four home runs in his career against Lincecum. ... Giants reliever Sergio Romo was unavailable because of a right knee injury, but is expected to return Friday. ... Arizona placed outfielder Jason Kubel on the paternity list and recalled A.J. Pollock from Triple-A Reno. ... Lincecum went the entire month of May without a win for his first winless month since going 0-5 in August 2010. ... The Giants have not homered in their last nine home games.