PITTSBURGH -- Ike Davis' pinch-hit, three-run home run in the eighth inning lifted the Pittsburgh Pirates to a 5-2 victory over the St. Louis Cardinals on Tuesday night.

Davis, out of the starting lineup for a sixth consecutive game while converted third baseman Pedro Alvarez again started at first base, connected with two outs off right-handed reliever Seth Maness (5-3) for his ninth home run of the season and third as a pinch hitter.

Left-hander reliever Tony Watson (9-1) got the win with two scoreless innings of relief, although he cost starter Gerrit Cole a victory by allowing two inherited runners to score.

The win was costly for the Pirates (68-64). Center fielder Andrew McCutchen left the game in the fifth inning with discomfort in his left rib cage, and Alvarez departed an inning later with discomfort in his left foot.

Lance Lynn allowed two runs in six innings for the Cardinals (71-60). He gave up six hits while walking three and striking out three.

Phillies 4, Nationals 3

PHILADELPHIA -- Carlos Ruiz drove in the go-ahead run with a sacrifice fly in the bottom of the eighth for the Phillies.

Second baseman Freddy Galvis and first baseman Darin Ruf homered for Philadelphia (60-72), which won for the fifth time in six games.

Second baseman Asdrubal Cabrera hit a game-tying homer off Cole Hamels in the eighth for Washington (72-56), which lost for the second straight night but only the third time in 15 games.

Jonathan Papelbon worked a perfect ninth for his 33rd save this season and his 100th as a Phillie, tying him with Brad Lidge for fourth on the team's all-time list.

Mets 3, Braves 2

NEW YORK -- Juan Lagares hit a two-run homer in the fourth inning and right-hander Dillon Gee tossed 6 2/3 solid innings to snap a seven-start winless streak.

The Mets (62-70) won despite the absence of their No. 2 and No. 3 hitters, second baseman Daniel Murphy and third baseman David Wright. Murphy was out with a tight right calf while Wright was scratched with neck spasms.

The Braves (68-64) lost their third straight and fell a game behind San Francisco in the race for the National League's second wild card, pending the Giants' game against Colorado.

Cubs 3, Reds 0

CINCINNATI -- Travis Wood pitched six shutout innings, and first baseman Anthony Rizzo and center fielder Arismendy Alcantara homered as the Cubs won their fourth straight.

Wood (8-11) allowed only two hits and a walk, striking out five, over 96 pitches. Hector Rondon earned his 22nd save for the Cubs (59-72), who have won six of eight.

Johnny Cueto (15-8) gave up three earned runs on seven hits for Cincinnati (63-69), which has lost eight of 10 and is 12-25 since the All-Star break.

Orioles 4, Rays 2

BALTIMORE -- Jonathan Schoop delivered the tiebreaking RBI single in the sixth, and Nelson Cruz added an RBI double an inning later for the Orioles.

The Orioles (75-55) got a big effort from their bullpen, which allowed just one hit over 4 1/3 shutout innings to lock up their second straight victory.

Cruz drove in first baseman Steve Pearce with his double to deep center off right-hander Joel Peralta in the seventh for the 4-2 edge over the Rays (64-68).

Astros 4, Athletics 2

HOUSTON -- Chris Carter hit his 32nd home run, a 439-foot, three-run homer that erased the Athletics' 2-1 lead in the eighth inning.

Right-hander Josh Fields (4-6) worked a scoreless eighth for the win as Houston (56-77) snapped a three-game losing skid.