TORONTO (AP) — In his first appearance in Toronto, Arizona Diamondbacks left-hander Robbie Ray didn't have to wait long for a taste of the explosive Blue Jays' lineup.

Facing the likes of Edwin Encarnacion and reigning American League MVP Josh Donaldson for the first time, Ray made it to the fifth batter he faced before he was forced to turn his head as Russell Martin launched a three-run shot to left-center.

The early flurry of offense propelled the Blue Jays to a 5-2 victory Wednesday, snapping the Diamondbacks' five-game winning streak and earning a split of the mini two-game series for Toronto.

"I just made a couple mistakes and left the ball over the middle of the plate and when I was trying to go in or get the ball away they made me pay for it," Ray (4-6) said. "They're a team that can hit and they can hit homers and this is a ballpark conducive to that."

Although the second-year pitcher settled down after his rude introduction, Encarnacion signaled the beginning of the end of his afternoon's work with another home run to left-center to lead off the sixth. One batter later he was replaced by Zack Godley, who promptly gave up an almost identical home run to Troy Tulowitzki to complete the scoring.

Ray lasted 5 1/3 innings, giving up four hits and four earned runs with eight strikeouts.

"I think the tone was set early with the three-run homer," Arizona manager Chip Hale said. "It was a mistake, and really, if you keep the Toronto Blue Jays in the ballpark you have a good chance of beating them and that was the one thing we really preached to our pitching. So the mistakes that we made went out of the ballpark today."

Hale praised Ray for settling down after the first inning and getting his team to the sixth with a chance to win. He was less impressed with leaving nine runners on base and striking out 12 times to complete a 26-strikeout two-game series.

"Too many," he said of the strikeout total. "We talk about it and sometimes you talk about it too much and guys get a little mental over it."

Left fielder Peter O'Brien, who was 1 for 4 with three strikeouts, took it in stride.

"We won five straight, this is the first loss we've had in five games," he said. "I think if we keep going up there and having good (at-bats) and obviously keep working but as long as we're winning ballgames and scoring runs I think that's in the background."

J.A. Happ picked up his team-leading ninth win for Toronto but he had to work to earn his third straight victory.

For just the third time in 15 games, the left-hander was unable to last into the seventh inning, throwing 99 pitches in five innings, giving up two runs and six hits, while walking four and striking out eight.

"It was a battle for sure," Happ (9-3) said. "I felt like I was executing some pitches and I suppose I was just missing there so it made for a lot of long counts. And four walks are too many. The bullpen came in and did an awesome job, picked me up, picked the team up."

Gavin Floyd, Drew Storen and Jason Grilli pitched one inning each to get the Blue Jays to the ninth, where Roberto Osuna picked up his 14th save and snapped the Diamondbacks' five-game win streak.

Tulowitzki extended his hitting streak to 10 games, while Encarnacion's 19th of the season represented his major league-leading 62nd RBI.

"I like the way he looks," manager John Gibbon said of Tulowitzki, who returned from the 15-day disabled list on June 18. "We need him to be good and he's done a great job since he's been back."

Arizona's Phil Gosselin capitalized on an error by right fielder Darrell Ceciliani to put the Diamondbacks on the board in the third inning. Arizona then had a chance to tie the game after Happ issued consecutive walks to load the bases, but the left-hander struck out Welington Castillo to end the threat. Michael Bourn added a run in the fourth with an RBI single.

A day after seeing his 13-game hitting streak end, Arizona first baseman Paul Goldschmidt went 2 for 2 with two walks.

BACK IN THE LINE OF FIRE

Arizona Coyotes goaltender Mike Smith, a native of nearby Kingston, Ontario, and a member of Canada's 2014 Olympic gold medal-winning squad, took batting practice with the Diamondbacks before the game.

TRAINER'S ROOM

Blue Jays: OF Ezequiel Carrera (sore Achilles) was replaced in right field by Ceciliani after jamming his leg against a base in Tuesday's series opener. Ceciliani, who celebrated his birthday on Wednesday, made his first start as a Blue Jay, while Carrera was given the day off. He was replaced as leadoff hitter by 2B Devon Travis. . RHP Marco Estrada, who left Tuesday's game with tightness in his back, is still on track to make his next scheduled start, Monday against Colorado.

UP NEXT

Diamondbacks: RHP Zack Greinke (10-3, 3.54) will face Rockies RHP Eddie Butler (2-4, 6.26) on Thursday as Arizona begins a four-game series at Colorado. In six road starts this season, Greinke is 5-0 with a 1.47 ERA, and is 7-4 lifetime with a 4.06 ERA against the Rockies.

Blue Jays: RHP Aaron Sanchez (7-1, 3.35) starts against White Sox LHP Carlos Rodon (2-6, 4.16) on Friday as Toronto starts a three-game set at Chicago. Sanchez will be making his first career start against the White Sox.