ST. LOUIS -- Marlins outfielder JT Riddle wiped out two months of frustration with one swing of the bat.
Riddle hit a two-run homer in the 11th inning, Zac Gallen was effective in his major league debut and Miami beat the St. Louis Cardinals 7-6 on Thursday night.
Brian Anderson also went deep and drove in two runs for the Marlins, who earned a split of the four-game series.
Riddle connected off Andrew Miller (3-3) with one out for a 7-5 lead.
"It felt good," Riddle said. "I put a good swing on it and squared it up."
Miller said he missed location.
"I threw it right down the middle," he explained. "Generally, I'm better with it."
Rookie infielder Tommy Edman homered for the Cardinals, who rallied from 4-1 and 5-3 deficits to tie it.
On deck, Albert Pujols returns Friday for his first game in St. Louis since leaving to sign a $240 million contract with the Angels before the 2012 season.
The slugger won three NL MVP awards and made nine All-Star teams with the Cardinals, leading them to World Series championships in 2006 and 2011. He is sixth on the career list with 645 home runs.
Jarlin Garcia (1-0) got the win with two innings of relief, and Sergio Romo closed for his 13th save in 14 chances. He gave up a two-out RBI double to Yadier Molina, but ended the game by picking off pitcher Jack Flaherty at second base.
Flaherty was pinch-running for Molina.
"I put him in that spot," St. Louis manager Mike Shildt said. "The reality is he wasn't prepped well enough and I take responsibility for that."
Edman tied it 5-all with a two-run homer off Tayron Guerrero in the eighth. It was Edman's first career round-tripper and it came in his 10th at-bat.
Gallen gave up one run and five hits in five innings. He struck out six and walked two.
"It was awesome," Gallen said. "I mixed my pitches pretty well. We threw a lot of off-speed (stuff) and kept them on their toes."
St. Louis starter Adam Wainwright allowed three runs and six hits over 5 1/3 innings in his return from the injured list. The veteran right-hander, who strained his left hamstring running the bases June 9, struck out six and walked one.
Anderson hit a solo homer off John Brebbia in the eighth to push Miami's lead to 5-3. It was his ninth of the season. Anderson also broke a 1-all tie with an RBI double off the glove of third baseman Matt Carpenter in the sixth.
Miguel Rojas gave the Marlins a 4-1 advantage when he knocked in a run with an infield single in the seventh.
"This was a crazy one," Miami manager Don Mattingly said.
Marlins: 1B Garrett Cooper was pulled in the fifth with left triceps tightness. He is day-to-day. Cooper, who missed Wednesday's game with the same problem, extended his hitting streak to a career-high 12 games with a double in the fourth. ... Miami catcher Jorge Alfaro exited in the ninth with concussion-like symptoms.
Cardinals: INF Yairo Munoz came off the paternity list and was placed on the restricted list due to travel delays in his return to St. Louis. ... INF Jedd Gyorko remains on the injured list with calf and back ailments. "It's going to be a little while. The calf strain is more significant than the back injury had been," general manager Michael Girsch said. Gyorko went on the injured list June 8.
Marlins: RHP Sandy Alcantara (3-6, 3.73 ERA) will face Phillies RHP Aaron Nola (6-1, 4.89) in the opener of a three-game series at Philadelphia on Friday. Alcantara game up a season-high six runs on a career-high 11 hits over five innings in a 9-1 loss to Philadelphia on April 12 in Miami.
More AP MLB: https://apnews.com/MLB and https://twitter.com/AP-Sports
Perez: Angels have a gripe with Ramirez suspension
Eduardo Perez disagrees with how Major League Baseball handled Noe Ramirez's suspension after he hit Jake Marisnick.
Yanks get speedy OF Gore from Royals for cash
Speedy outfielder Terrance Gore has been traded to the New York Yankees by the Kansas City Royals for cash.
Perez: Baines played with a lot of dignity
Mike Petriello explains how Harold Baines' election to the Hall of Fame reveals flaws in the voting process, while Eduardo Perez says it's time to celebrate his election.
Indians' Kluber throws successful bullpen session
The Indians say pitcher Corey Kluber threw a successful bullpen session at Progressive Field on Wednesday, the right-hander's first time throwing from a mound since fracturing his right forearm on May 1.
Solano's go-ahead homer keys Giants 11-8 win over Rockies
Donovan Solano had four hits, including a tie-breaking home run leading off the sixth inning, and the San Francisco Giants beat the Rockies 11-8 on Wednesday to complete a four-game series sweep, their first at Colorado in nearly eight years.
Rays-Yankees game postponed due to severe weather forecast
The scheduled game between the Tampa Bay Rays and New York Yankees has been postponed due to a forecast of thunderstorms and severe weather.