ST. LOUIS (AP) — The stats say it was a dominant outing for Brandon McCarthy. He says it was luck.

"It felt like most everything was just a little bit off," McCarty said after the Los Angeles Dodgers' 4-3 loss to the Cardinals in 16 innings Friday night. "We were pretty fortunate to get through that. Maybe just effectively wild. Early on they seemed to be really aggressive and I was missing spots by enough to where it was harder to hit."

He pitched 6 1-3 innings while giving up one hit. But that hit from Aledmys Diaz in the third scored two with the last coming on a fielding error by Joc Pederson.

McCarthy, who is still rounding into form following Tommy John surgery last year, left in the seventh with leg cramps. He was fine after drinking some pickle juice and eating a jalapeno "which was miserable" he said.

"At that point in time it was going to be his last hitter anyway and with the leg cramp it made sense to get him out of there," Dodgers manager Dave Roberts said. "He gave us everything he had and he just continues to throw the ball really well."

Corey Seager was the other bright spot, going 4-for-7 after missing the last three games with the flu. He drove in the Dodgers first run in the first inning.

"Corey is a special young man and for him to have three days off and come back maybe not even full strength to throw up four hits is pretty tough to do," Roberts said.

Matt Adams homered in the 16th inning to lead the Cardinals to their season-best fifth straight victory.

It was the second consecutive game that the Cardinals won in their final at-bat. They beat the Padres on Thursday after scoring a run in the ninth inning.

Adams homer came with one out off Bud Norris (5-9), who gave up six runs as a starter in an 8-1 loss at Washington on Wednesday.

"I didn't feel the ball come off the bat," Adams said of the 444-foot blast to left. "So, I knew I squared it up. I knew it was going to go."

Seth Maness (1-2) picked up the win with a scoreless inning of relief for St. Louis, which was playing its longest game of the season.

Jedd Gyorko hit a two-out homer off closer Kenley Jansen in the ninth to tie the game 3-3. It was the second blown save for Jansen during the Dodgers' current nine-game road trip.

"It just seems like it's that one mistake pitch," Roberts said. "The stuff's still good. Gyorko his nitro zone is down and in and that was a ball that was supposed to be away that leaked down and in and he put a good swing on it."

Justin Turner and Howie Kendrick homered for the Dodgers. Los Angeles has lost four of six. The red-hot Turner has seven homers and 17 RBI this month. He hit two homers in a 6-3 win over Washington on Thursday.

Turner blasted his career-high 18th homer of the season off Seung Hwan Oh in the ninth to break a 2-2 tie.

Kendrick's solo shot in the sixth tied the game 2-2. He has hit in 14 successive games trying Colorado's Charlie Blackmon for the longest current streak in the majors.

Dodgers reliever Adam Liberatore recorded his 28th successive scoreless outing by retiring two of four batters in the seventh. He has not allowed a run in 41 of 42 appearances this season.

TRAINING ROOM

Dodgers: OF Yasiel Puig (hamstring) was out of the starting lineup, but manager Dave Roberts said he's 85 percent and expects him to start on Sunday.

Cardinals: IF/OF Brandon Moss (ankle) is expected to go on a rehab assignment early next week. IF Matt Carpenter (right oblique) took ground balls and did light throwing.

UP NEXT

RHP Kenta Maeda (8-7, 3.25) will face RHP Mike Leake (7-7, 4.30) in the second game of the three-game set on Saturday. Maeda is 5-2 with a 3.31 ERA in nine road starts this season. Leake has not walked a batter in the last 19 innings covering three starts.