Starling Marte capped a four-hit night with a dramatic solo homer with two outs in the bottom of the ninth inning to send the Pittsburgh Pirates to a 6-5 win over the Toronto Blue Jays.

Pedro Alvarez tied the game with a two-run blast in the bottom of the ninth. Both homers came off Sergio Santos (0-2), who suffered his third blown save of the season and saw his ERA rise to 10.61.

Neil Walker singled to start the home ninth, and after Andrew McCutchen struck out, Alvarez put a charge into a 95 mph fastball over the wall in center.

Pinch-hitter Ike Davis then flied out to center field, but Marte took Santos deep into the Pittsburgh bullpen beyond the center-field wall for his first career walk-off homer. It was also his first extra-base hit since April 14 at Cincinnati.

McCutchen had three hits and two RBI for the Pirates, who also got three hits and three runs scored from Walker. Pittsburgh, which had 17 hits, snapped a three-game skid and won for just the second time in nine games.

"We've had the opportunity a number of different times for sparks," Pirates manager Clint Hurdle said. "We've talked about it about five different ways. This is the fifth way it's been brought up to me after a game, could this be the spark to start something? I believe all of them could be sparks. This is the next opportunity for us to move upon some momentum."

Mark Melancon (1-1) pitched the top of the ninth to get the win.

Colby Rasmus belted a two-run homer and Jose Bautista continued his impressive start to the season at the plate for the Blue Jays, who have dropped seven of their last nine contests.

Brandon Morrow scattered 11 hits and allowed three runs over five innings, while Pittsburgh starter Gerrit Cole surrendered seven hits and four runs over five frames.

"The defense was playing really good behind me. I got a lot of ground balls, even for hits," Morrow said.

Bautista, who doubled twice and drove in a run, extended his hitting streak to 12 games. He's reached base safely in all 29 contests to begin the season, which ties Vernon Wells for the longest such mark in club history. It's also the best streak to begin a year since Joey Votto had a 33-game run for the Reds to start the 2011 campaign.

Juan Francisco doubled to start the fourth inning and went to third on a wild pitch. One out later, Rasmus homered to left field to provide the visitors with a 3-2 edge.

Bautista's double to right the next inning scored Jose Reyes to extend the lead, but McCutchen's line single to left plated Walker in the bottom portion.