Pittsburgh was boosted by a pair of big innings, scoring four times in the first inning off Tom Koehler. But after Miami made it a one-run game, the Pirates sealed the win by tacking on three runs, all with two outs, in the seventh inning.
"You look at tonight," Miami manager Mike Redmond said. "We gave up seven runs in two big innings. Those are innings we've got to limit the damage."
Christian Yelich provided a two-run homer off Locke, but Miami was unable to complete the comeback.
On Tuesday night, the Marlins rallied with a five-run eighth inning to take the first game of the series.
"You don't want to spot a team like this four runs," Koehler said. "Locke was an All-Star last year. He's capable of putting up a lot of zeros. We all know about their bullpen. I didn't really put our team in position to win that ballgame from the beginning."
The Marlins weren't able to catch a break in the seventh inning, as a check swing by Russell Martin was ruled a ball, despite replays showing the catcher went around. The pitch proved crucial, because Martin was able to deliver a run-scoring single off Mike Dunn, who initially thought he had an inning-ending strikeout. Home-plate umpire Bill Miller appealed to first-base umpire Chad Fairchild, who ruled no swing.
The pitch in question was a 1-2 slider in the dirt. Catcher Jeff Mathis blocked the ball and applied the tag, but the out was not awarded.
"The second he started to swing, I knew he went," Dunn said. "I was just making sure Jeff got it and tagged him out. Then we looked down and he said he didn't go. You have to clear your mind and you've got to get back on the mound and get going. But I still have got to make up for that. I was ahead in the count. That didn't put me behind. I didn't execute the pitch after the fact."
After Martin's hit, Sanchez broke the game open with a two-run double.
Locke actually got the rally started with a single off Chris Hatcher, who was charged with two runs in the inning.
After a rough first, Koehler settled and made it through six innings without allowing any further damage. The right-hander ended up allowing four earned runs on five hits with four walks and four strikeouts. Two of the free passes came in the first inning.
Both teams got off to a fast start offensively.
The Marlins claimed a first-inning lead on Jeff Baker's RBI infield single.
But the Pirates countered with four runs in the first off Koehler, who struggled finding the strike zone. Of his 33 pitches, 17 were strikes. Pittsburgh sent eight to the plate and scored two runs on Davis' ground-rule double. Travis Snider had a run-scoring groundout, and Jordy Mercer ripped an RBI single to right with two outs.
Miami closed the gap to 4-3 in the second on Yelich's two-run homer to right. It was the 22-year-old's ninth shot of the season, but first off a lefty. In his two-year career, Yelich has just two of his 13 homers off southpaws.
Locke retired the final 13 he faced, not allowing a baserunner after Baker's single in the third.
"The momentum shifted for me in the first," Redmond said. "We scored the run. We had momentum on our side. We come back and give up four. Then bounce back. Yeli hits a big homer and puts us back in it. Things settled for both sides until the seventh inning."