ST. LOUIS (CBSMiami/AP) — The Miami Marlins were walked-off by the St. Louis Cardinals on Wednesday night, falling 2-1 in extra innings.

Even though he wasn’t in the starting lineup, Paul Goldschmidt didn’t take the night off.

READ MORE: Parkland dad Manuel Oliver "very angry" following Texas elementary school shooting

Goldschmidt hit a solo home run with two outs in the bottom of the 11th inning to give the Cardinals the win.

Dexter Fowler had an RBI single in the sixth for the Cardinals, who won for the seventh time in 11 games. Miguel Rojas tied it with a single in the eighth off reliever Carlos Martínez.

After beginning the game on the bench, Goldschmidt entered at first base in the ninth. Two innings later, he launched a 453-foot drive on a changeup from Adam Conley (1-7) for his fifth career walk-off home run.

“It was a tight game the whole time, so you know you’re not starting, but being prepared to face a bullpen guy,” Goldschmidt said. “I had a chance there in the ninth and struck out. It’s nice to be able to come through and help us win.”

St. Louis loaded the bases with none out in the 10th, but Sergio Romo escaped for Miami. He struck out Harrison Bader and got Marcell Ozuna to ground into an 8-4-3 double play started by center fielder JT Riddle as part of a five-man infield.

“Clearly that’s not the recipe,” Cardinals manager Mike Shildt said. “We just maybe need a better approach right there. We’re not trying to do anything too special. They’ve got two outfielders and we’ve got a fly ball pitcher.”

Cardinals starter Daniel Ponce de Leon gave up two hits over six shutout innings and was in line to earn his first major league win before Rojas’ single tied it.

READ MORE: 18 children, 2 adults killed after shooter opens fire at Texas elementary school

Ponce de Leon struck out six and walked one in the longest of his three starts this season. It was the first time the right-hander did not allow a run in nine career starts.

“I had all four of my pitches working,” Ponce de Leon said. “The wins, it doesn’t matter as long as it’s in one of our team’s columns.”

John Gant (7-0) got the win with a perfect inning.

Miami has lost three of four.

Marlins right-hander Trevor Richards, from Aviston, Illinois — 40 miles east of St. Louis — went 5 2/3 innings before leaving after 108 pitches. He tied a season high with eight strikeouts and gave up four hits while walking three.

Richards pitched around a pair of walks in the third, but couldn’t get out of more trouble in the sixth. Fowler’s single, the third hit of the inning, snapped a 14-inning scoreless drought for the Cardinals and ended Richards’ night as he left to boisterous applause from his hometown cheering section.

“Whenever I was walking off the field there it was pretty crazy,” Richards said. “I looked up and it looked like half the stadium from my point of view was standing up. That’s incredible.”

MORE NEWS: Florida lawmakers tee up property insurance changes

(© Copyright 2019 CBS Broadcasting Inc. All Rights Reserved. The Associated Press contributed to this report.)