Updated

PITTSBURGH (AP) — Jeff Keppinger homered and had three RBIs, Brett Myers allowed two runs while working into the eighth inning and the Houston Astros remained unbeaten in seven games against the Pittsburgh Pirates this season with a 5-2 win Friday night.

Myers (7-6) extended his club record for consecutive starts of at least six innings to begin a season to 19 by allowing two runs on five hits in 7 2-3 innings, striking out four and walking one.

Matt Lindstrom worked a perfect ninth for his 22nd save in 26 opportunities.

Andrew McCutchen went 2 for 4 with an RBI and a run for Pittsburgh, which has lost seven consecutive overall.

Making his first start in exactly one month, the Pirates' Zach Duke (3-9) pitched five effective innings, allowing two runs on five hits with no walks and five strikeouts. But he lost for the ninth time in his last 10 decisions.

In the Astros' first game with former star Jeff Bagwell as their hitting coach, the team scored at least five runs for only the third time in its past 10 contests.

Keppinger, a former Pirates farmhand who is 7 for 13 in his past three games, has hit three of his four home runs this season in his past six games. He also had an RBI double in the seventh and drove in Jason Bourgeois with a groundout in the first.

That meant the Pirates had allowed at least one first-inning run for the sixth time in their past seven games. This came without a ball reaching the outfield — an infield single, two stolen bases and a groundout.

Houston took a 2-0 lead with two outs in the second when Humberto Quintero doubled in Hunter Pence.

McCutchen scored on Neil Walker's sacrifice fly in the fourth.

D.J. Carrasco relieved Duke in the sixth, and Keppinger took the first pitch he threw and hit it just inside the left-field foul pole to make it 3-1. Later that inning, Pence scored on a squeeze play with Angel Sanchez at the plate.

The Pirates chased Myers in the eighth when McCutchen's two-out single drove in Lastings Milledge. Jose Tabata followed with a single off of Brandon Lyon, but Walker's sinking liner to left was caught by a running Bourgeois to end the threat.

Notes: Houston — 37-53 overall — improved to 20-14 in intra-division games. ... The Pirates have had five losing streaks of at least five games this season. This is the third time they have lost seven in a row. ... Pittsburgh had won five of its previous six at home.