TORONTO -- B.J. Upton saw Max Kepler dive for his sinking drive in the eighth inning and when the ball skipped past the right fielder he was thinking triple.

What he did not see was Kepler kicking the ball as he made a sliding attempt to pursue it. Kevin Pillar, who had doubled, scored the tying run on Upton's hit.

Upton continued all the way home for what proved to be the winning run and the Toronto Blue Jays came back to defeat the Minnesota Twins 8-7 on Saturday.

It was scored an RBI triple and an error.

Upton said he could not remember scoring like that before, even in Little League.

"That's a first time," he said. "I saw him dive, I kind of knew it would be a triple once it got by him, but rounding second I saw Luis (third base coach Rivera) keep waving me and I kept going."

Edwin Encarnacion homered and had three RBIs for the Blue Jays, who trailed 5-0 and 7-3 before handing the Twins their ninth straight loss.

"There's all different kinds of ways to lose games," Twins manager Paul Molitor said. "That one was particularly difficult. Things just snowballed. You've got a team that's certainly capable of scoring runs in a hurry and got a little momentum. That was a tough one to endure, especially those last couple of innings.

"Max is trying to make a play and get us off the field with a lead and he came up short. He's trying to do something to help us win."

Blue Jays manager John Gibbons said Upton has injected speed into the team's lineup.

"That's one part of our team we don't have a whole lot of, is team speed," Gibbons said. "A guy like that can make a huge difference. We've seen him steal bases; he's one of those guys that can go first to third just about every time.

"If he hits it in the gap, it could turn into three. ... That was a huge play."

Reliever Jason Grilli (5-3) pitched around a single in the eighth to pick up the win and Ryan Pressly (6-6) took the loss, allowing two runs and five hits in one inning.

Roberto Osuna pitched a perfect ninth with two strikeouts to earn his 29th save of the season.

Brian Dozier had three hits and two RBIs, and Trevor Plouffe hit a home run and had two RBIs for the Twins.

Twins starter Ervin Santana allowed five hits, five walks and six runs while striking out four in six innings.

"They're an aggressive team and they don't swing at very bad pitches, either," Santana said. "(The clubhouse is) a little down. At the same time, we have to come tomorrow, erase this game today and then play hard tomorrow.

"We had the lead for a couple of good innings and then we gave it in the blink of an eye."

Toronto starter Marcus Stroman allowed nine hits, one walk and five runs in six innings. He struck out five.

Stroman appreciates what Upton has brought to the Blue Jays since he was acquired on July 26 in a trade with the San Diego Padres.

"He' an unbelievable player, gives that added element of power and speed," Stroman said. "Any time he's in there, he can go deep or steal a base or go first to third, first to home. He's dynamic out there and we're excited to have him."

The Blue Jays (73-56) entered the game with a one-game lead over the Boston Red Sox in the American League East.

The Twins (49-80) scored a run in the first. Dozier led off with a single, stole second, took third on Joe Mauer's fly out to left and scored on a wild pitch.

Minnesota scored four runs in the fourth to take a 5-0 lead.

Plouffe led off with a walk and Eddie Rosario singled. Miguel Sano hit an RBI single, Eduardo Escobar hit an RBI double and Dozier stroked a two-run double.

Toronto scored in the bottom of the fourth when Encarnacion walked and Michael Saunders doubled.

Josh Donaldson walked with one out in the sixth and scored on Encarnacion's 36th home run of the season, cutting the Twins' lead to 5-3.

Bo Schultz allowed a walk and Plouffe's ninth home run of the season in the seventh as the Twins bumped their lead to 7-3.

The Blue Jays scored three in the bottom of the seventh to trim the lead to 7-6.

Pillar led off with a single and was forced at second by Upton. Devon Travis walked, Josh Thole grounded out to first and Jose Bautista walked to load the bases.

Pressly replaced Santana and allowed Donaldson's two-run single and Encarnacion's RBI single.

NOTES: Toronto 2B Devon Travis (sore right ring finger) returned to the lineup Saturday. He missed four games after receiving a cortisone injection in the finger on Tuesday. ... Twins 1B Joe Mauer (quadriceps) returned to the lineup after missing three games because of leg soreness. ... Blue Jays C Josh Thole started with regular C Russell Martin on the bench. ... Toronto OF Michael Saunders (tight hamstring) started in right field after missing two games after he tweaked his hamstring on Wednesday. ... RF Jose Bautista started as the designated hitter on Saturday. ... Minnesota RHP Kyle Gibson (5-8, 5.09 ERA) faces Toronto RHP R.A. Dickey (9-13, 4.43 ERA) in the series finale Sunday. ... The Blue Jays designated LHP Aaron Loup for assignment and recalled RHP Bo Schultz on Saturday.