At 5 hours and 32 minutes, it was the longest home game in Diamondbacks history as far as time elapsed and tied for the longest at home in terms of innings.
Yadier Molina drove in three runs, including a leadoff home run that put St. Louis up 8-7 in the seventh, but Aaron Hill's RBI single tied it at 8-8 before both teams scored a run in the 12th.
Pennington was 0 for 11 to start the season before getting three hits in the extra innings.
The Diamondbacks, who won two of three against the Cardinals, came from behind four times to either take the lead or tie the game.
Paul Goldschmidt and Martin Prado each hit a two-run homer, and Gerardo Parra homered, tripled and singled for the Diamondbacks.
Josh Collmenter (1-0) allowed one run on four hits in five innings to get the victory. Fernando Salas (0-1), the last pitcher available in the St. Louis bullpen, took the loss.
In the 16th, Kubel drew a leadoff walk. Ian Kennedy, Arizona's opening day starter, pinch hit for Collmenter and put down a sacrifice bunt to move Kubel to second. That brought up Pennington, whose single to center finally ended it.
Daniel Descalo tied his career high with four hits for St.
Paul Kozma's RBI single off Collmenter put St. Louis up 9-8 in the 12th, but in the bottom half, Mitchell Boggs allowed a leadoff single to Pennington and hit Eric Chavez in the ribs. Parra's sacrifice bunt advanced the runners then Prado's sacrifice fly tied it 9-9.
Arizona's Brandon McCarthy allowed six runs on nine hits in five-plus innings in his first outing since sustaining a horrific head injury last Sept. 5.
McCarthy, while pitching for Oakland, took a line drive to the side of his head off the bat of Erick Aybar of the Los Angeles Angels, sustaining what the Athletics described at the time as life-threatening injuries. McCarthy was hospitalized and underwent surgery after sustaining an epidural hemorrhage, brain contusion and skull fracture.
He signed with Arizona as a free agent in the offseason.
Molina singled in a pair in the Cardinals' four-run third.
Lance Lynn, an 18-game winner last season, had a 4-1 lead after four but never got an out in the fifth.
Parra narrowly missed a second home run with a triple off the wall in left-center, then scored on Lynn's wild pitch. Prado singled, then Hill bounced one over the fence into the pool area in right-center for a ground rule double to put runners at second and third.
Randy Choate relieved Lynn and gave up an RBI sacrifice fly to Miguel Montero. Choate left in favor of right-hander Joe Kelly, whose first pitch was lined by Goldschmidt off the top of the wall in left for a two-run homer that put Arizona up 5-4.
But McCarthy didn't get an out in the sixth. Matt Adams singled and Kozma doubled to put runners at first and second. Left-hander Tony Sipp replaced McCarthy and surrendered a two-run single to Descalso and St. Louis regained the lead 6-5.
Notes: Arizona's previous longest home game was 5 hours, 14 minutes. ... Parra opened the game for Arizona with his first career leadoff home run. ... Arizona OF Cody Ross, on the 15-day DL (left calf strain), begins a rehab assignment at Class A Visalia on Thursday. ... The Cardinals open a three-game series at San Francisco on Friday, sending RHP Jake Westbrook to the mound against the Giants LHP Barry Zito. ... LHP Wade Miley goes for the Diamondbacks at Milwaukee on Friday, with RHP Kyle Lohse starting for the Brewers.