Harbaugh took the heat for Kaepernick's errant pitch in the fourth quarter that led to a 2-yard fumble return for touchdown by Janoris Jenkins. Combined with a 2-point conversion, that tied it at 10 with 3:04 to play. Harbaugh said it was "the wrong play to call at the time."
"I would have loved to have that one back, but don't blame the players on that one," Harbaugh added.
Kaepernick also gave up a safety when he was whistled for intentional grounding in the end zone. Though he rallied the 49ers to a go-ahead field goal late in regulation, he felt the sting of defeat.
"I gave up those points that were on the scoreboard for the Rams, so that's 100 percent on me," Kaepernick said. "I've just got to keep working. There's nothing more you can do than keep working and get ready for next week."
Leading 10-2, Kaepernick was well off the mark on a pitch to Ted Ginn Jr. from the San Francisco 17 on third-and-3, and Jenkins fell on it at the 2 before flopping into the end zone.
Tight end Lance Kendricks beat coverage from Patrick Willis on the 2-point conversion as the Rams succeeded even after a false start penalty on tackle Rodger Saffold.
"I just pitched it high," Kaepernick said. "It was my fault all the way, I gave up those points that were on the scoreboard for the Rams, so that's 100 percent my fault."
Greg Zuerlein kicked a 54-yard field goal with 26 seconds left in overtime. The rookie's winning kick came after he sent the game into overtime with a 53-yard field goal as time expired in regulation.
The Rams (5-6-1) have won two straight after an 0-4-1 skid.
The 49ers (8-3-1) failed to take advantage of a 14-yard punt by rookie Johnny Hekker to midfield when David Akers was barely wide right on a 51-yard attempt with 4:11 to go in overtime. Akers is just 7 for 15 from 40 yards and beyond.
Zuerlein is 7 for 11 from the 50 and beyond and had plenty of distance on the kick on fourth-and-inches. Before the 53-yarder at the end of regulation, he had missed four of his previous seven attempts including a 58-yarder near the end of the half.
Most of the game was a defensive struggle, nothing like the 24-24 tie in San Francisco. Michel Crabtree was a rare offensive standout with seven catches for 101 yards, while St. Louis rookie Chris Givens had 11 receptions for 92 yards.
Akers' 33-yard field goal put the 49ers ahead with 1:38 remaining, a score set up by Kaepernick's 50-yard carry on a rollout. It left just enough time for Sam Bradford to guide the Rams 45 yards in seven plays.
The 49ers' Frank Gore scored the only offensive touchdown of the game on a 1-yard run late in the first quarter. Kaepernick's run to the St. Louis 14 at the two-minute warning behind a convoy that included Gore, who upended linebacker Rocky McIntosh.
The Rams failed on fourth-and-1 from the 4 earlier in the game when Bradford couldn't connect with Austin Pettis in the right corner of the end zone against double coverage, leaving them with nothing to show for their best possession of the game.
P N.Y. Giants at Washington, 6:30 p.m., ESPN