The Cubs pulled within 3-2 in the fourth with some clutch two-out hitting. With one out, Ryan Kalish singled and John Baker walked. After a groundout moved the runners to second and third, Hammel singled, his first hit of the season, to right to drive in both.
"The hit was nice. I was just trying to get the foot down early," Hammel said. "I was still late, but found a hole. (Cards starter Lance Lynn) provided most of the distance with his velocity."
Hammel went six innings, allowing seven hits and three runs. St. Louis scored two runs in the second after two were out and Hammel issued a walk and then another in the third with the same scenario.
"Just can't do that. Two-out walks after two quick outs," Hammel said. "Put a guy on base and bad things happen. That's what happened tonight."
The Cubs tied the score in the seventh when Luis Valbuena tripled with two outs and scored on a wild pitch by reliever Carlos Martinez on the first pitch to Starlin Castro.
Valbuena doubled in a run with two outs in the ninth to make it 5-4, but Rosenthal got Anthony Rizzo to ground out to end the game.
NOTES: The ESPN broadcast team of Dan Shulman and John Kruk worked from the bleachers. ... While making a rehab start Sunday with Double A Springfield, LHP Jaime Garcia (shoulder) was hit by a pitch on the left elbow and left after two innings and 28 pitches. "I think they went in and took precautionary X-rays," Matheny said. "I haven't heard anything back yet." ... In the same game, RHP Jason Motte threw a scoreless inning, striking out three, in his first rehab outing. ... Rizzo entered with a .429 on-base percentage, which was fifth-best in the National League. ... The Cards open a series in Atlanta on Monday, with RHP Shelby Miller (3-2) facing RHP Aaron Harang, while the Cubs host the crosstown White Sox with RHP Jeff Samardzija (0-3) going up against LHP Jose Quintana (1-2).