ST. LOUIS – It took 95 days and 16 starts, but Sonny Gray was finally a winning pitcher once again.

Thursday's start was a fitting way to break a dubious streak because it was one of Gray's better outings of the season. He completed seven innings in 77 pitches, matching his longest start of the year, in the Twins' 5-3 victory over the Cardinals at Busch Stadium.

Gray earned his first win since April 30, ending a 15-start winless streak that defied logic for an All-Star pitcher. It was the longest single-season winless streak by a Twins starter since the franchise moved to Minnesota in 1961.

"Not a lot of wins came in for a while, so maybe now you'll go on a run and win every game you start [or] at least the team wins the game," said Gray, who permitted five hits and two runs. "Hopefully, that's coming in the future."

Gray, who has been plagued by one blowup inning in recent starts, simply stayed in the strike zone and challenged hitters. He recorded his first nine outs in 32 pitches, and he had three innings in which he threw fewer than 10 pitches. He reached only one three-ball count.

The Twins staked Gray to a four-run lead in the second inning. It was the first time the offense scored more than three runs while Gray was still on the mound since June 15.

"I've just been building and trending in a direction with filling up the zone," Gray said. "You know, there for a minute, that wasn't necessarily happening. A few homers may come with that. A few hits may come with that. At the end of the day, they may not, too."

Making his first start since the trade deadline — multiple teams inquired about his availability — Gray wasn't perfect, but he was relentless. He surrendered an RBI double to Dylan Carlson in the second inning and then retired his next seven batters. Alec Burleson hit a two-out solo homer in the sixth inning, and Gray shrugged it off.

"You see the outings when he has those big innings, and they spiral a little bit," catcher Ryan Jeffers said. "It's a couple walks. Today, you see when he has a good outing, he gets behind a guy 2-0, he's going to come right after you, right in the middle of the plate and say, 'Here's my best stuff. Try and hit it.' I think that's what he did really well."

Winning gave the Twins a 2 1/2-game lead in the American league C

The Twins, the league's worst-hitting team against lefthanded pitching, strung together a four-run second inning against Cardinals lefty Matthew Liberatore. Ryan Jeffers, who noticed how much Miles Mikolas attacked him with curveballs on Tuesday, launched a curveball to center field for a two-run homer to extend his hitting streak to 10 games.

Willi Castro followed with a double that deflected off Liberatore's foot into left field. Liberatore, after a visit from a trainer, started Michael A. Taylor with a 3-0 count. Taylor received the green light to swing on the next pitch and rocketed a fastball to the third deck in left field, the ball soaring over a sign that read "Big Mac Land."

Gray went 4-0 in April, then went 0-4 over the next three months while the Twins posted a 4-11 team record during his winless stretch. Gray was aware of the streak, but he said it was just as rewarding to end a six-game road trip with a win.

"Sonny has just put up quality start after quality start," Taylor said. "The fact that he hasn't won since April has nothing to do with the way he's been pitching. We knew it was only a matter of time."