For the first six innings Friday night, it looked like Jeff Samardzija would receive long-awaited and ample run support only with another team.

The Cubs' offense finally broke through with three runs in the seventh and eighth innings while Samardzija held his own with seven innings of one-run ball against the National League champion Cardinals.

Those were the first runs scored by the Cubs with Samardzija on the mound since the seventh inning against the Brewers at Miller Park on Sept. 17, 2013.

But even that breakthrough wasn't enough, as closer Jose Veras hit two batters and issued a walk that led to two runs in the ninth and deprived Samardzija of a well-deserved victory.

Still, it turned out all right as catcher Welington Castillo, whose passed ball allowed a run in the ninth, gained a measure of redemption when he smacked a three-run homer off Trevor Rosenthal that traveled 426 feet and gave the Cubs a 6-3 triumph in 11 innings.

The Cubs finally capitalized on second baseman Kolten Wong's error in the seventh inning to give Samardzija some support. Ryan Sweeney, starting in center field as manager Rick Renteria went with a predominantly left-handed hitting lineup against Cardinals starter Joe Kelly, poked a single to left to score Anthony Rizzo and snap a streak of 32 consecutive scoreless innings while Samardzija was pitching.

Samardzija's performance further bolstered those who believe he is or is close to being a top of the rotation starter for a playoff contender as teams are expected to resume their pursuit of Samardzija later this season.

In three starts this year, Samardzija has allowed three runs while walking five and striking out 15 in 21 innings — 14 innings against 2013 playoff teams.

Before the game, Renteria sensed Samardzija relished the challenge of facing a playoff contender like the Cardinals.

"He's very emotional, a very driven individual," Renteria said. "This (game) does heighten it a bit. (But) every time he goes out there, he's going to give his best.''

Samardzija kept his composure after he thought he struck out Matt Carpenter on an 0-2 pitch with two outs and runners at first and second in the fifth.

Samardzija took a few steps off the mound, only to see umpire Gabe Morales had called the pitch a ball. Samardzija rebounded to retire Carpenter on a fly to center.