Diamondbacks left-hander Wade Miley carried a two-hit shutout into the ninth but was lifted after giving up back-to-back singles to Neil Walker and pinch hitter Gregory Polanco to start the inning. Closer Addison Reed (1-4) blew a save for the fourth time in 23 chances.

Marte drove a double off the top of center field fence to tie the score. After Andrew McCutchen was intentionally walked, Davis lined a single to right to score Marte and give the Pirates their eighth win in 10 games.

Nationals 7, Rockies 1

Jayson Werth had two hits and three RBIs, and Stephen Strasburg allowed just one run in 7 2/3 innings as Washington beat visiting Colorado. The Nationals won their fourth game in a row.

Werth entered the game hitting .135 in his last 13 games, but he had an RBI double in the first and a two-run double in the fourth.

Strasburg (7-6) improved to 6-2 at home as he struck out eight and walked one.

Cubs 2, Red Sox 1

Luis Valbuena drove in the go-ahead run with a sacrifice fly off Boston closer Koji Uehara in the ninth inning, then made a game-saving stop to end the game.

Uehara (3-2) yielded a leadoff single to first baseman Anthony Rizzo before shortstop Starlin Castro moved the runner to third with a double to left. Valbuena brought Rizzo home with a fly to shallow right.

Hector Rondon pitched the ninth for his 11th save of the year, getting help from a diving stop by third base Valbuena with a runner at second. Valbuena threw out Dustin Pedroia at first base, and the call was confirmed by a video review.

Marlins 5, Phillies 4 (11 innings)

Ed Lucas hit a one-out, walk-off single in the bottom of the 11th inning to lead Miami to a win over visiting Philadelphia.

The winning rally started when pinch hitter Jeff Baker singled off Phillies reliever Justin De Fratus and was bunted to second by Christian Yelich. That set the stage for Lucas, who went the other way and lofted a soft liner just over the head of first baseman Ryan Howard. It was Miami's seventh walk-off hit of the season.

The Marlins snapped a four-game losing streak.