Subscribe for $3 for three months

SAN DIEGO — It wouldn’t have mattered how far Matt Wieters’ home run traveled or how many stories it climbed up the Western Metal Supply Co. building at Petco Park if not for the 90 feet Paul Goldschmidt seized to tie the game or the one foot the Padres came shy of winning it.

Wieters’ two-run, two-out homer in the 11th inning carried the Cardinals to a 5-3 victory Sunday against San Diego that halted a losing streak at five games and allowed a clubhouse a moment to exhale. The Cardinals scored five unanswered runs to avoid a series sweep, and got a little help from the Padres and technology to grease the comeback.

Two errors allowed Goldschmidt bonus bases to score the tying run in the eighth inning, and video replay confirmed a double play that ended the eighth to keep the Padres’ go-ahead run from scoring. For a team looking for something, anything, everything to recharge its offense, even the smallest bump can be beneficial.

“We’re not thrilled about the (loss) Saturday and you’ve got a quick turnaround and you’re down 3-0,” manager Mike Shildt said. “There was not a doubt in the dugout about how we’re going to compete and how we were going to be done at the end of the game. That speaks well. It’s a team effort.”

The box score became a melting pot of performances, not one of which alone would be enough to win for the Cardinals, but in concert made for a timely crescendo.

Yairo Munoz rescued the Cardinals from a botched inning with his two-run, two-out single for the team’s first runs. Closer Carlos Martinez (2-0) struck out the side in the ninth to force extra innings — and then pitched one of those two on the way to a win. Dominic Leone got the final two outs for his first save of the season, Goldschmidt turned an infield single into a key run, Tyler O’Neill had a necessary single, and starter Miles Mikolas recovered from allowing a first-inning homer to provide a quality start.

All of that eventually found Wieters at the plate in the 11th inning with two outs and lefty Brad Wieck on the mound. Switch-hitter Wieters had yet to get a hit vs. a lefty this season.

By his own admission, the lack of looks at lefthanded pitching had kept his righthanded swing clunky and long, and he counted four or five at-bats that weren’t competitive. He was 0 for 19 batting righthanded going into the at-bat against Wieck, and knew the number well.

“It’s easy when you don’t have any” hits, Wieters said. “After you get the first (you lose track). It was a grind earlier in the year.”

To break free from that funk, Wieters has worked to shorten his swing on the right side, simplify it, and when Wieck tested him with a pitch on the outside corner he got a chance to see if the change helped. A pitch he couldn’t reach earlier this season, he fouled off. The next one, a helium-filled breaking ball, he put 390 feet away — on the third deck of the warehouse beyond left field at San Diego’s ballpark.

“Complete team win,” Wieters echoed.

• BOX SCORE: Cardinals 5, Padres 3

To buy time for the Cardinals’ inanimate offense to stir and then hold the tie into extra innings, the bullpen threw five scoreless innings and held the Padres to two hits. Six relievers got at least one out for the Cardinals, and Shildt split the bottom of the 11th between lefty Tyler Webb and Leone. Starter Adam Wainwright headed to the bullpen to be ready as insurance if the game slipped away at that point. He told Shildt that he could pitch “until the cows come home.”

“Well, they came home early,” Shildt said.

Only because the Cardinals got some help getting home from the Padres.

Entering the sixth inning, the Padres had outscored the Cardinals 18-3 in the series. Cardinals’ position players had gone 23 consecutive at-bats with a runner in scoring position and not produced an RBI. They had three runs total in their previous 39 innings. San Diego starter Joey Lucchesi, a funky lefty, struck out six of the first 18 Cardinals he faced.

The speed bump came in the sixth. Lucchesi walked two Cardinals and left the bases loaded for his teammate, former Cardinals’ prospect Luis Perdomo. The righthander struck out Tyler O’Neill to nudge that number to 24 consecutive key at-bats without an RBI. On the brink of another misplayed inning, Munoz struck for a grounder up the middle to score Jose Martinez and All-Star Paul DeJong.

“It’s almost like an attitude that we have to will our way into winning as opposed to keeling over and losing our focus,” DeJong said. “Also, (it’s) not wanting to hit a three-run homer when you’re the leadoff guy. You’ve got to take the situation and figure out what the team needs. Most of the time it’s a baserunner.”

That’s all Goldschmidt was in the eighth.

The first baseman, getting a test drive at cleanup, hit a slow roller for an infield single. When Manny Machado rushed the play and committed an error, Goldschmidt cut left and took the offered base.

Without it, he’s at first. Without it, he likely only gets to second on O’Neill’s single to right. Without it, he’s not scoring the tying run. O’Neill’s right to right glanced off the tip of right fielder Franmil Reyes’ glove, and with that error Goldschmidt broke from third to level the game 3-3. Of the 360 feet he ran, 180 came from errors.

“When you’re struggling to score runs, maybe try to do it in another way,” Goldschmidt said. “You can help yourself by getting that extra base. It’s definitely a good thing that we kept fighting, that we didn’t get down.”

“Good teams take advantage of opportunities on the other side,” Shildt said.

Even better teams do it again.

Cardinals Update e-newsletter

* I understand and agree that registration on or use of this site constitutes agreement to its user agreement and privacy policy.

Derrick Goold is the lead Cardinals beat writer for the St. Louis Post-Dispatch and past president of the Baseball Writers' Association of America.