Kyle Gibson appeared headed for a short outing, and the Minnesota Twins' playoff outlook looked as shaky as their starting pitcher.

Minnesota's offence boosted both with a big rally.

Eddie Rosario homered twice, Joe Mauer hit a grand slam and the Twins overcame a five-run deficit to beat the Toronto Blue Jays 13-7 Sunday and maintain control for the second AL wild card.

Game Wrap: Toronto Blue Jays lose series finale to the Minnesota Twins2:14

Minnesota trailed 5-0 in the second inning after Josh Donaldson's second homer. Rosario and Byron Buxton hit consecutive homers to start the rally as the Twins burst ahead with a seven-run bottom half that included Jorge Polanco's tiebreaking RBI grounder.

"You never feel like your offence is going to put up 13 runs," Gibson said. "But that inning kind of had that kind of a feel. You can see early on when the guys have a lot of confidence. Rosie hits that homer and Buck hit that homer. They both walk by me and say, 'Hey, we got you. Let's go."'

Minnesota pulled away with six runs in the fifth against reliever Chris Rowley. The Twins reopened a two-game lead over the Los Angeles Angels for the second AL wild card and closed within four games of the Yankees heading into a three-game series at New York that starts Monday.

Biagini gets chased 

Gibson (11-10) allowed five runs, three hits and five walks in six innings while tying a season high with eight strikeouts to help the Twins gain a four-game split.

Minnesota manager Paul Molitor nearly took out Gibson early.

"There was one pitch away a couple of times," Molitor said. "It's hard to explain a beginning like that. Of all the things he's done, this one's, in some ways, is maybe a little more impressive to give us six innings after that start."

Joe Biagini (3-11) gave up six runs — four earned — and five hits in 1 1/3 innings for Toronto. He is 0-1 with a 15.00 ERA in two starts and two relief appearances against the Twins.

"I put them in a tough position for what they want to do," Biagini said. "I don't blame them for taking me out. I wish I would have gotten a chance to stay in, fight through it and limit the damage. But I understand what they're thinking, so I don't blame anybody."

Jays-Twins-17092017

Joe Biagini, facing , of the Toronto Blue Jays is pulled in the second inning against the Minnesota Twins on Sunday. (Jim Mone/The Associated Press)

Rosario also homered in the fifth for his fourth career multihomer game and went deep five times during the homestand. Mauer hit his fourth slam, his first since Sept. 1, 2012, at Kansas City and his first ever at home.

Minnesota tied a franchise record by homering for the 16th consecutive game and has a major league-high 74 since Aug. 8.

Gibson walked four batters as the Blue Jays took a 4-0 lead in the first, and Donaldson homered again in the second. Gibson retired his final 13 batters he faced.

Donaldson reached 30 homers for the third straight season after hitting 29 in 2014. He has an AL-high 21 home runs since the AL break, including consecutive multihomer games.

According to MLB Statcast, Donaldson's first-inning drive into the third deck would have traveled 481 feet, tying it for the seventh-longest home run tracked by Statcast this season.