With the score 4-4 in the seventh, Pittsburgh's Gregory Polanco led off with a double to center against reliever Matt Strahm (0-1). He moved to third on Francisco Cervelli's flyout and, an out later, scored when Padres third baseman Christian Villanueva bobbled Corey Dickerson's grounder for an error.
San Diego had won three of four.
Neither starter made it out of the fifth inning.
Pittsburgh right-hander Chad Kuhl gave up four runs and six hits in 4 1/3 innings, with five strikeouts and two walks. He had not given up more than three runs in his past 14 home starts, dating to last May 31.
San Diego rookie left-hander Eric Lauer, making his fifth career start, allowed four runs and six hits in 4 2/3 innings, with three strikeouts and three walks.
Pirates reliever Edgar Santana (2-0) got one out in the seventh for the win. Felipe Vazquez struck out the side in the ninth and improved to 9-for-9 in save opportunities.
San Diego took a 2-0 lead in the third inning. Freddy Galvis led off with a single, Manny Margot walked, and Lauer's bunt moved them to second and third. Travis Jankowski's infield single brought home Galvis, and Eric Hosmer's fielder's choice drove in Margot.
The Pirates scored three in the fourth. Cervelli drew a one-out walk and moved to third on Josh Bell's single. Dickerson drove in Cervelli on a double that left fielder Franchy Cordero misjudged, and Bell scored on David Freese's sacrifice fly to tie it 2-2.
Sean Rodriguez gave Pittsburgh a 3-2 lead when his double brought home Dickerson.
The Padres moved back on top 4-3 in the fifth. Hosmer's double off the wall in right-center drove in Lauer, who led off with a double, and Jankowski, who walked.
Bell's RBI single in the fifth pulled Pittsburgh into a 4-4 tie.
--Field Level Media