DETROIT – If the Twins get to where they want to go, righthander Kyle Gibson has had a big hand in the journey.

And that seemed unlikely earlier this season, when he made not just one, but two visits to Class AAA Rochester.

It took a while for things to click, but the Twins are in position to close out the AL's second wild-card spot. And Gibson has been one of their best starters of late.

He wasn't fully on his game Friday night, but still was effective enough to guide the Twins to a 7-3 victory over the Tigers at Comerica Park. After getting swept by the Yankees in three games, the Twins have won the first two games of this four-game series. They expanded their wild-card lead to 3½ games over both the Angels, who lost at Houston, and the Rangers, who lost at Oakland.

"These two games were big for us to get the ship turned in the right direction," Gibson said, "and we can hopefully keep it going."

Gibson went seven innings Friday, holding Detroit to three runs on five hits — including solo homers by Nicholas Castellanos and Ian Kinsler — and two walks with six strikeouts on a night in which he did not have his good curveball. Of the 91 pitches he threw, only 52 were strikes. And he threw only nine first-pitch strikes to the 25 batters he faced.

But Gibson also induced three double-play grounders, two from Miguel Cabrera, to be able to make it deep into the game. He has six victories in his past seven outings. At 12-10, he is one victory shy of his career high set in 2014.

"It's been quite a run," Twins manager Paul Molitor said. "He's gotten the run support. But he's backed it up. The timing of his turnaround couldn't have been any better for our club."

Gibson started the season 0-4 with a 8.20 ERA, leading to the first of his demotions to Rochester. But since the All-Star break, Gibson is 7-3 with a 3.57 ERA. Ervin Santana is 5-2 with a 3.87 ERA. Jose Berrios is 4-6 with a 4.37 ERA. Bartolo Colon is 4-6 with a 5.33 ERA.

"You spend seven weeks being part of the problem, being a guy who can't be relied on," Gibson said. "Get sent down for the first time in a few years and work on things. And they give you another chance. It's all I can really ask for."

Twins hitters come alive, for some reason, with Gibson on the mound. The offense entered Friday averaging 7.8 runs on the day he pitches. That includes 50 runs over Gibson's previous four starts.

After a slow start Friday, the Twins reached seven runs again.

Max Kepler homered off Tigers lefthander Daniel Norris in the third to tie the score at 1-1. It was Kepler's second homer in four days off a lefthander after the lefthanded-hitting right fielder hadn't done that all year.

Detroit led 2-1 in the fourth when the Twins scored three runs, two coming on a two-run double by Byron Buxton. The Twins added an RBI single by Eduardo Escobar in the fifth, an RBI double by Robbie Grossman in the sixth and a home run by Brian Dozier, his 32nd of the season, in the ninth.

By then, the Twins bullpen was finishing up what Gibson started, as Trevor Hildenberger pitched the eighth and Matt Belisle worked the ninth as the Twins evened the season series with Detroit at 7-7.

And Gibson continued to be a big asset down the stretch, getting the Twins one game closer to the wild card.

"All I've been trying to do," Gibson said, "is, every five days enjoy myself and try to get better, little by little."