DETROIT — Carlos Corporan took the Tigers’ series sweep and lined it to deep left-center field.

The Astros catcher’s RBI double off Detroit’s Phil Coke in the top of the ninth was a go-ahead game-winner, pushing a struggling club to a 7-5 victory Wednesday at Comerica Park.

The Astros (11-30) ended a six-game losing streak, avoided a three-game sweep by Detroit and downed the Tigers (22-16) for the first time this season in seven contests.

Astros lefthanded starter Dallas Keuchel gave up seven hits and five runs (four earned) during 5 2/3 solid innings in a no-decision.

Tigers righty Max Sherzer allowed five runs and five hits in seven innings.

The Astros grabbed a brief 1-0 lead after Corporan hit his third home run of the season into the right-field stands, blasting a 3-2, two-out pitch from Scherzer.

Detroit answered with four runs in the bottom of the frame. After Keuchel induced ground outs from Prince Fielder and Victor Martinez, the Astros’ 25-year-old starter temporarily lost his command and control. Jhonny Peralta walked, Matt Tuiasosopo singled to right and a Brayan Pena infield single tied the game at 1. Astros shortstop Marwin Gonzalez caught Pena’s grounder near second base but was unable to complete a throw to first when he couldn’t get the ball out of his glove.

Avisail Garcia followed Pena and placed the Astros in a deeper hole. Garcia hammered a 2-0 pitch to deep left-center field.

The ball landed in the Astros bullpen, became the first home run of Garcia’s career and gave the Tigers a 4-1 advantage.

But Scherzer was hit even harder in the fourth. Jake Elmore doubled, Carlos Pena singled, Chris Carter walked and J.D. Martinez made it 5-4 Astros after bouncing an 85 mph slider off the Tigers’ Wall of Fame in deep left-center field.

Keuchel settled in from the third through fifth innings, not allowing a run and only being touched by the bottom of Detroit’s lineup. He was one out away from making it through six before a Gonzalez fielding error allowed Victor Martinez to reach first. Back-to-back singles by Peralta and Tuiasosopo followed, and the latter tied the contest at 5.

Corporan pushed the Astros over the top in the ninth, hammering a first-pitch fastball from Coke that scored pinch-runner Brandon Barnes. A Matt Dominguez sacrifice fly gave closer Jose Veras a two-run window in the bottom of the final frame.

Veras loaded the bases after hitting Torii Hunter on an 0-2 pitch with two outs. But Detroit’s Miguel Cabrera flied out to deep right-center on a ball caught by Brandon Barnes against the digital scoreboard.

Photo: Duane Burleson / Getty Images

Image 1of/37

Caption

Close

Image 1 of 37

May 15: Astros 7, Tigers 5

Brandon Barnes goes up against the wall to catch a fly ball hit by Miguel Cabrera for the final out.

May 15: Astros 7, Tigers 5

Brandon Barnes goes up against the wall to catch a fly ball hit by Miguel Cabrera for the final out.

Photo: Duane Burleson / Getty Images

Image 2 of 37

Brandon Barnes leads the team during their postgame handshakes after defeating Detroit in the series finale.

Brandon Barnes leads the team during their postgame handshakes after defeating Detroit in the series finale.