The Cardinals finally found the secret to beating the Twins on Wednesday: just wait for a friendly face on the pitcher’s mound.

Lance Lynn, who spent the first six seasons of his major league career in St. Louis, lasted only three wearisome innings against his old team, gave up three runs, and set in motion the Twins’ first and only loss to the Cardinals this year, 7-5 at Target Field.

The control issues that have marred Lynn’s brief tenure as a Twin, a problem that now has him at the bottom of the American League in walks per nine innings (6.99), returned after a brief hiatus, and turned what might have been a so-so outing into a pitch-count time bomb. He allowed no hits except singles, four in all, and recorded five strikeouts with his lively 95-miles-per-hour fastball among the nine batters he retired. But he constantly compounded his predicament with four walks, ultimately ending the Twins’ five-game winning streak against the Cardinals, dating to 2015.

“Lance is still fighting it a little bit as far as command. You know, 82 pitches in three innings, that makes it tough,” Twins manager Paul Molitor said. “Up here, it can be a fine line sometimes. It just hasn’t happened for him.”

Worst of all Lynn, who walked away from the Cardinals as a free agent last winter, had chances to extricate himself from trouble, but twice allowed run-scoring hits with two outs. Dexter Fowler drove home two with a two-out slash to center in the first inning, and Jose Martinez got a two-out smash past a diving Logan Morrison in the second, driving in another run.

Lynn labored in the humid 80-degree sunshine to record nine outs, setting a drowsy pace for a game that lasted nearly four hours. Was it strange facing his familiar former teammates, to try to beat the team that never bothered to offer a multiyear contract last winter despite his 72 victories in St. Louis?

“For me, it was just another bad start this year,” Lynn said. “That’s pretty much what I’ve done so far, so it wasn’t really different.”

He’s got a point. Lynn, who has never finished a season with a losing record or an ERA above 4.00, is now 1-4 as a Twin, with a 7.47 ERA.

“He’s aware it’s been a struggle so far,” Molitor said. “Sometimes, subconsciously or consciously, you’re trying too hard to get back on track. Pitching against the Cardinals [Wednesday] was something he was probably looking forward to, but it didn’t work out particularly well.”

Especially since Lynn was facing Miles Mikolas, the righthander whom the Cardinals chose to sign instead of him. Mikolas, who was also offered a contract by the Twins, signed to a two-year deal last December as he returned from a successful three-year stint in Japan, and though he failed by one out to finish five innings and earn the victory — he allowed two runs on seven hits — he remains 5-0 with a 2.63 ERA thus far.

The Twins, who had outscored the Cardinals 17-2 in winning the first three games between the teams this year, kept mounting rallies, two of them powered by Morrison, who hit his first opposite-field homer of the season. But a trio of inning-ending double plays kept them from ever overcoming St. Louis’ early lead. And their best chance to catch the Cardinals, who scored four runs off the Twins’ bullpen, was foiled by the tip of a first baseman’s spike.

Trailing 7-3 entering the eighth inning, the Twins collected two walks and two singles off longtime Royals closer Greg Holland. When Cardinals manager Mike Matheny turned to his current closer, Bud Norris, a wild pitch cut the lead to 7-5 with two runners in scoring position and only one out.

But Norris struck out pinch hitter Eduardo Escobar, then induced Gregorio Petit to hit a ball to shortstop Paul DeJong’s right. The long throw was in time to retire Petit, but off-target. But St. Louis first baseman Matt Carpenter managed to maintain a sliver of contact with the bag as he stretched to snag it and end the inning.

“If you want to look for positives, we kept playing. We had the go-ahead run up” to bat, Molitor said. “We just had trouble containing them [Wednesday].”