ST. LOUIS -- Jeff Samardzija had studied film of the Cardinals for days and couldn't find any weaknesses, so he focused on what he could do best, and it worked.
Samardzija picked up his first win since May 27 as the Cubs beat the Cardinals, 4-2, on Tuesday night to even the four-game series.
"It's a rivalry game, and with that aside, you have a respect for [the Cardinals] and how they play the game and how they set their lineup up, one through nine," Samardzija said.
"You know you've got to come at it," he said. "I'm watching film five days before, and trying to find some weaknesses, and you can look as hard as you want and you're not going to find it. You just know your margin of error against this team is real small and you've just got to deal with it."
Besides having to face the best offense in the National League and the team with the best record in the Majors, he also was up against 10-game winner Adam Wainwright, who entered with a 2.18 ERA. But Ryan Sweeney and Cody Ransom hit back-to-back home runs in the first off the right-hander to back Samardzija.
"This is our rivalry, and every big game, [Samardzija] seems to pitch really well," Cubs manager Dale Sveum said.
Samardzija was efficient and effective, giving up seven hits, including a solo home run to Carlos Beltran in the sixth, and striking out six over 8 1/3 innings. He exited after serving up two singles in the ninth. Kevin Gregg took over, and gave up a RBI single to unstoppable Yadier Molina.
David Freese then hit a grounder to second baseman Darwin Barney, who flipped to shortstop Starlin Castro for the force at second. Pinch-runner Shane Robinson, who was on first, slid hard into Castro and well off the bag, and second base umpire Fieldin Culbreth called interference on the play to end the game.
"[Robinson] wasn't even close to the base and he had his cleats up," Castro said. "I understand that you can try to break up the double play in that kind of situation but not like that. ... I couldn't throw the ball."
Sveum was happy with the result.
"We finally got a call in this place, I know that," Sveum said. "There have been some bad walkoffs in this place. Whatever it was, it was a good call for us."
Cardinals manager Mike Matheny agreed.
"[Culbreth] had the right call," Matheny said. "The baserunner was out of the line. We teach the guys to play hard all the way through it, but he made the right call. It's just frustrating to see the game end like that when the guys are making such a great push at the end. He got it right."
Samardzija was at 104 pitches through eight innings, but Sveum did not consider pulling the right-hander.
"He wanted to finish and I gave him the chance to finish, and it didn't work out," Sveum said.
Samardzija kept the Cubs infielders busy. There was only one flyout in the game, and that was when Matt Carpenter ended the eighth with a fly ball to right fielder Nate Schierholtz. The Cubs right-hander credited a tweak in his mechanics, which helped his fastball be more effective.
"I really wanted to kick this June bugaboo," Samardzija said. "I've been working real hard and I just like where I'm at right now."
In his career, he's 2-8 with a 7.14 ERA in June, which includes an 0-4 record and 10.41 ERA in five starts last year in the month.
"The movement he had on his ball tonight and keeping hitters off-balance and still throwing 96, 97 [mph] in the ninth inning, that's huge, especially with how hot it is," Sweeney said. "He kept the ball down and had his sinker going. Whenever you keep the ball down, that's a plus for the defense."
No Rizzo? No problem. The Cubs' lineup was without Anthony Rizzo, who was given his first game off this season. Sveum didn't say how long the first baseman would sit, just that he needed a "breather" after batting .157 this month. Rizzo is 3-for-6 against Jake Westbrook, who starts Wednesday.
Ransom moved from third to first, only his seventh career start there. It didn't seem to affect his swing.
Wainwright needed six pitches to retire the first two batters of the game, and then the Cubs went to work. Schierholtz doubled and scored on Alfonso Soriano's double. Sweeney followed with his second home run, and first by a lefty off Wainwright this season, and Ransom hit a solo shot. It's the third time this season the Cubs have hit back-to-back home runs, and the first since April 29, when Scott Hairston and Ransom did so against the Padres.
"[Wainwright] was a pitch away to 'Sori' from getting out of there with nothing and 'Sori' came up with the big double," Sveum said. "There were some big hits in that inning."
Wainwright had given up four runs in the first inning over 14 starts combined, and the Cubs matched that. He also needed 28 pitches to get through the first, while Samardzija zipped through the Cardinals' half, throwing nine pitches, eight for strikes.
The Cubs lost a heartbreaker on Sunday to the Mets, and wasted another solid effort by Travis Wood on Monday against the Cardinals. It hasn't been an easy season.
"We're the Chicago Cubs, so you know there's always something going on, something being talked about," Samardzija said. "If you can't deal with that, you better play somewhere else. We're a great team in here, we get along real well. Despite different things that happen throughout the year, that's how it goes.
"With the last game in New York and yesterday, I wanted to come out and do a job for this team and get us back on track."
Carrie Muskat is a reporter for MLB.com. She writes a blog, Muskat Ramblings, and you can follow her on Twitter @CarrieMuskat. This story was not subject to the approval of Major League Baseball or its clubs.