Karstens (1-1) combined with four relievers on a four-hitter. Jaramillo, the Pirates' backup catcher, tied a career high with his third three-hit game and had an RBI single.
The Pirates won for the fourth time in their last five games and beat St. Louis for just the fourth time in the last 14 meetings. The Cardinals lost their fourth in five games.
The Pirates will need to drop someone from the starting rotation and 25-man roster Monday, when Ross Ohlendorf is scheduled to be activated from the disabled list to start that night against Cincinnati after missing a month because of back spasms.
Karstens is the most likely candidate to be moved into a long relief role or sent to Triple-A Indianapolis because Zach Duke, Paul Maholm and Charlie Morton are assured of spots in the rotation. Manager John Russell said Brian Burres deserves to keep starting after pitching a combined 12 1/3 scoreless innings in his last two outings.
Russell smiled when asked who would be the odd man out in the rotation.
"It's a good problem to have," Russell said. "Jeff did a great job and really kept a very good lineup off balance. He kept the ball down and from an angle that made it hard for them to get a lot of good swings."
Karstens, who threw only sinkers and sliders in his 74-pitch outing, said he did not approach the start as if he was pitching for a job.
"I wasn't worried about that," he said. "I was just worried about getting them out."
Octavio Dotel pitched the ninth, earning his sixth save in eight opportunities to complete the Pirates' second shutout of the season.
"We just couldn't get anything going offensively," St. Louis manager Tony La Russa said. "You have to give their starting pitcher and relievers a lot of credit. It just wasn't a good day for our offense."
Cardinals rookie Jaime Garcia (3-2) pitched well again but had nothing but a loss to show for it after allowing one run and seven hits in six innings. He walked two and struck out seven. The left-hander has allowed one run or less in five of his six starts this season, lasting at least six innings each time out.
Pittsburgh scored its lone run off Garcia in the second inning when Steve Pearce, Jaramillo and Ronny Cedeno hit consecutive one-out singles. Cedeno's hit deflected off the glove of diving third baseman David Freese.
Jaramillo singled off Mitchell Boggs in the eighth inning to increase the Pirates' lead to 2-0.
St. Louis' best scoring chance came in the sixth, but Ryan Ludwick, who had doubled, was thrown out at home by left fielder Lastings Milledge to end the inning while trying to score on Colby Rasmus' single. Ludwick argued vehemently with home plate umpire Marty Foster that Jaramillo missed on his swipe tag.
"You never see me get that upset unless I know for a fact that I was safe," Ludwick said.
Jaramillo gave a sly grin and a non-answer when asked if he tagged Ludwick.
"The umpire called him out and Marty's a good umpire."
"It was a tough spot because he's the best hitter in the game but I really felt confident I could get him," Hanrahan said.
The Cardinals have been either shut out or held to one run in eight of their 12 losses.
Andrew McCutchen had two doubles and a walk for the Pirates. He is 9 for 13 (.692) in his last four games and 22 for 50 (.440) in his last 12.
St. Louis OF Matt Holliday (strained groin) was not in the starting lineup but singled as a pinch hitter in the eighth inning. La Russa is hopeful Holliday will be able to play Sunday ... Pittsburgh 1B Jeff Clement, who is in a 1-for-21 slump that has dropped his batting average to .173, was on the bench for a fourth straight game. He continues to do extensive pregame work with hitting coach Don Long. Clement pinch-hit in the sixth and struck out looking with two runners on to end the inning. ... The game-time temperature was 49 degrees, 33 degrees colder than on Friday night.