Updated

Ryan Braun ended an extremely long day at the ballpark with a long drive that put him in the Milwaukee Brewers' record book.

Braun's home run off Lance Lynn with one out in the top of the 13th inning was the difference in the Brewers' 5-4 victory over the St. Louis Cardinals on Friday night.

The shot gave him his fifth straight 100-RBI season and further frustrated the few hundred fans still around nearly seven hours after the scheduled start.

The game lasted 4 hours, 30 minutes, and ended at 2:05 a.m.

"I can't ever remember playing in a longer game," Braun said. "Get here and sit around for eight or nine hours and then we play extra innings. I can't ever remember playing past 2 in the morning."

The start was delayed by rain for 2 hours, 20 minutes, long enough to cause one lineup scratch. Cardinals No. 3 hitter Matt Holliday was set to return after a game out with lower back pain followed by a day off but was scratched as a precaution.

Braun set a franchise record for 100-RBI seasons, breaking a tie with Cecil Cooper and Prince Fielder, with his 199th career homer. The drive off Lynn (13-7) came on a 1-1 hanging breaking ball and landed in the mostly empty left-field stands. Lynn was a first-time All-Star with 12 wins at the break but was bumped to the bullpen in late August.

"It wasn't supposed to go over the fence, that's for sure," Lynn said. "He's a guy that's going to hurt you. I made the wrong pitch to the wrong guy at the wrong time."

Brandon Kintzler (1-0) got cleanup hitter Allen Craig to ground into an inning-ending double play in the 12th, and John Axford finished for his 26th save in 34 chances. The Brewers have won 10 of 13 to climb into the fringe of the NL wild card race.

"We're here this late, we're thinking, 'Let's win this thing,'" reliever Kameron Loe said. "This was a grind all the way, though."

Both starting pitchers, St. Louis' Kyle Lohse and Milwaukee's Yovani Gallardo, failed much earlier in their second attempts to reach 15 wins.

"I knew coming into it that it was going to be a pretty late start. It takes more than that to mess with me," Lohse said. "I was ready and felt like my stuff was good."

The Cardinals got a pair of one-out walks in the 12th against Kintzler and left the bases loaded in the 11th against Loe, but couldn't score and fell to 3-10 in extra innings.

"It's extremely frustrating," manager Mike Matheny said. "We had our chances and just couldn't come through."

Yadier Molina's two-run homer off Jim Henderson tied it at 4 with two outs in the eighth. It was his 18th shot of the season and first since Aug. 24.

The drive answered the Brewers' two-run eighth. Corey Hart scored the go-ahead run from second on an infield hit combined with shortstop Daniel Descalco's throwing error.

Jon Jay had three singles and a steal for the Cardinals, who have the lead for the second NL wild card spot, but are 2-2 on a six-game homestand. Jay is batting a major league-best .390 (46 for 118) since Aug. 6, and Molina is batting .385 (20 for 52) against Milwaukee with three homers and eight RBIs.

The Brewers' Martin Maldonado ran into a big out to end the top of the 11th, trotting to first while admiring a drive to left center off Fernando Salas that didn't make it out. He was thrown out at second by left fielder Adron Chambers.

Gallardo finished strong with four of his six strikeouts in his final two innings in a rare acceptable outing against the Cardinals. The Milwaukee ace is 1-9 with a 6.72 ERA for his career against St. Louis.

Lohse, who allowed two runs and five hits in 6 1-3 innings, kept alive an eight-game winning streak over his last 14 starts.

Pinch-hitter Travis Ishikawa, who had been 1 for 12 against St. Louis, tied it at 2 in the seventh with an RBI double off Edward Mujica.

Carlos Beltran was 0 for 3 with runners in scoring position his first three trips and has just one RBI in 14 games. Beltran, in an 0-for-13 slump overall, missed two games this week because of soreness in his left knee.

NOTES: Cardinals closer Jason Motte worked the ninth and 10 innings. He allowed a hit and struck out two in his fifth two-inning outing of the season, all at home. ... Mujica has allowed just four of 22 inherited runners to score, and has worked 16 scoreless innings in 17 appearances since being acquired from Miami. ... Brewers manager Ron Roenicke said Carlos Gomez, who made his 78th start in center field, could be the opening day starter at that position next year. "I think we think he can do it," Roenicke said. "I'm not saying that he will be, but I could see him doing it." ... Lohse is 14-2, the second-best start in franchise history trailing only Ted Wilks, who was 14-1 in 1944 and finished at 15-2. ... Brewers 3B Aramis Ramirez missed his second start with a back injury but could be back Saturday.