Matheny said he'd have batted Kozma with less than two outs. He also banked on another shutdown inning from Rosenthal, who needed just six pitches in the 10th.
"You've got a real good feeling he's going to bring us back in with another zero," Matheny said. "We had two shots at getting the guy in from second."
Hector Rondon finished for his first career save.
Veras hit two batters and walked another in the ninth. One run scored on a passed ball by Castillo, helping the Cardinals score twice in the inning. Matt Carpenter's bases-loaded sacrifice fly tied it at 3.
Veras has blown both his save chances and has allowed five earned runs in 3 2-3 innings with three hit batters and seven walks.
"A shaky outing," Cubs manager Rick Renteria said, "but he's still our guy."
Chicago starter Jeff Samardzija worked seven economic innings for the third straight start, exiting with a 1.29 ERA. He finally got some runs to work with, but was denied a win for the ninth straight outing since Aug. 24 at San Diego.
"You keep pitching and giving your team a chance to win," Samardzija said. "Everyone is trying to do their jobs and sometimes balls find holes, and sometimes they don't."
Ryan Sweeney's RBI single off Carlos Martinez tied it in the seventh and was the Cubs' first run in 21 innings when Samardzija starts. Anthony Rizzo's sacrifice fly off Kevin Siegrist snapped a tie in a two-run eighth.
Cubs pinch hitters were 1 for 18 before the eighth inning when Justin Ruggiano, batting for Samardzija, singled off Martinez, and Mike Olt, batting for Luis Valbuena, singled off Siegrist.
Molina's RBI single in the second was his 10th hit in 18 career at-bats against Samardzija. He had two hits and is batting .455 (25 for 55) with three homers and 17 RBIs against the Cubs the last two seasons.