Updated

Pittsburgh, PA (SportsNetwork.com) - Ike Davis and Gaby Sanchez each knocked in two runs to help the Pittsburgh Pirates to a 7-3 win over the Miami Marlins on Wednesday.

Jeff Locke (3-3) allowed three runs on six hits with seven strikeouts over seven innings to grab the win.

"He stayed with his programs, stayed with his strengths," said Pirates manager Clint Hurdle. "He knows what he needs to do to have success."

Josh Harrison went 3-for-4 with two runs out of the leadoff spot for Pittsburgh, while Russell Martin, Travis Snider and Jordy Mercer each contributed an RBI.

Tom Koehler (7-9) took the loss after yielding four runs on five hits over six innings on the hill.

Christian Yelich hit a homer in defeat and Jeff Baker knocked in the other run for Miami, who have lost two of three.

Casey McGehee sent a single out to right with two outs in the first that put runners at the corners and Baker followed with an RBI single to open the scoring.

Pittsburgh answered in the home half with a four-run inning. Harrison doubled to lead things off, Gregory Polanco and Martin both walked before Davis laced a ground-rule double to left-center field that plated two.

Snider added an RBI groundout later in the inning and Mercer capped the scoring with a run-scoring base hit to right.

"You try to clear your mind, almost pretend like it didn't happen," Koehler said of the four-run inning. "It's nice to be able to go six innings in a game like that."

Miami continued the scoring in the second with Yelich knocking a two-run homer to right that cut the deficit to 4-3.

Each starter tossed up zeros from there until the Bucs added some cushion with a three-run seventh. Martin drove in Harrison with a single to left and a pinch-hitting Sanchez followed with a double to right that scored Polanco and Martin.

Tony Watson and Mark Melancon each pitched a scoreless inning of relief to close out the win.

Game Notes

Pittsburgh went 4-for-12 with runners in scoring position, while Miami went 2- for-4 in those instances ... Harrison stole his 14th base of the season in the win ... Baker had two of Miami's seven hits, the only Marlin with multiple knocks ... Miami left-hander Brian Flynn will take the mound in place of Jarred Cosart, who will miss his turn in the rotation with left oblique soreness, opposite of Edinson Volquez in the series finale against the Pirates on Thursday.