PHOENIX -- After the longest home game in Arizona Diamondbacks history, Cliff Pennington found himself with mud in his hair and a plastic bubble gum container on his head. A game-winning hit can do that.
"All the innings wasn't fun, but the party at the end was fun," Pennington said.
Pennington's third single of the game drove in Jason Kubel with one out in the 16th inning Wednesday, giving the Diamondbacks a 10-9 victory over the St. Louis Cardinals at Chase Field.
The game lasted five hours, 32 minutes and featured the return of Brandon McCarthy.
"I'm just trying to get something I can hit hard. I got a pitch that was good enough," said Pennington, who was 0-for-11 before getting three straight hits in extra innings.
"I started out for 0-for-whatever it was. I didn't think I was going to get a hit all year. To get some hits in extra innings and get a big one like that is good. I wasn't losing confidence or anything."
Teammates Gerardo Parra and Martin Prado put water and dirt on Pennington's head as he was mobbed on the field.
"They were jumping on me. I had mud in my hair. Whatever else you could do, they decided that was going to be good."
Kubel walked to open the 16th against Fernando Salas (0-1) and was sacrificed to second base by pitcher Ian Kennedy, who was batting for reliever Josh Collmenter. Pennington followed with single to make a winner of Collmenter, who gave up one run in five innings after pitching 1 2/3 innings the previous day.
Parra, Prado and Paul Goldschmidt each had three hits and a home run for Arizona, which won a series against St. Louis for the first time since 2010. Prado tied the game with a two-run homer in the sixth, then added a sacrifice fly in the 12th.
"Excuse me if I'm smiling," D-backs manager Kirk Gibson said.
Daniel Descalso had four hits for St. Louis. Matt Adams had three hits, and Yadier Molina had two hits, including a home run, and three RBI.
The Cardinals led 4-1, 7-5, 8-7 and 9-8, losing their last leads in the eighth and 12th innings.
"We had some chances to finish it off," St. Louis manager Mike Matheny said. "They did, too. It was just one of those back and forth to see who's standing in the end."
St. Louis shortstop Pete Kozma singled home a run in the top of the 12th inning for a 9-8 lead before Prado's sacrifice fly with out in the last of the inning tied it again.
Molina's solo home run gave the Cardinals an 8-7 lead in the seventh before Aaron Hill's run-scoring single tied the game in the eighth.
"That was just a really fun game to be a part of," said Allen Craig, who had two doubles and an RBI for St. Louis. "It was really long. I wish it was a little bit shorter and we would have won, but it was fun to be a part of."
Molina also hit a two-run single in a four-run fourth inning off new D-backs right-hander McCarthy, who was making his first major league start since suffering a brain contusion and a skull fracture when he was struck on the right side of the head by line drive Sept. 5 while with the Oakland A's.
McCarthy gave up six runs and nine hits in five-plus innings, leaving after the Cardinals got two hits to open the sixth.
McCarthy, who underwent surgery the night he was hurt to stabilize the skull fracture, signed a two-year, $15.5 million free agent deal with the D-backs on Dec. 7 after being cleared by concussion specialists in Pittsburgh in late October.
NOTES: St. Louis right fielder Carlos Beltran (hairline fracture, right little toe) grounded out as a pinch hitter in the 10th inning after being held out of the starting lineup. Beltran played through the injury while competing with Puerto Rico in the World Baseball Classic but took several days off after reporting to the Cards' spring training camp in late March. He was 1-for-5 in the first two games of the series. ... Newcomer Heath Bell gave up home runs on his first and 10th pitches in his Arizona debut on Tuesday, Gibson calling it a location issue. Gibson and pitching coach Charles Nagy looked at film Wednesday morning and noticed a slight difference in Bell's delivery from 2011, but "nothing major, no," Gibson said. "We talked to him in the bullpen. It's one game." ... McCarthy walked on five pitches in the second inning, the first time in 12 career plate appearances he had reached base.