Quarterback Manning, the four-time NFL MVP who sat out last season with a neck injury before being cut by the Indianapolis Colts, completed 10-of-12 passes for 122 yards.
He found Eric Decker with touchdown strikes of 10 and five yards, and led the Broncos to a Matt Prater field goal on his other possession, before being withdraw from the fray after less than a quarter.
The Broncos led 17-0 at that point but the 49ers soon responded through a 44-yard Vernon Davis touchdown catch from Alex Smith.
David Akers kicked five field goals as San Francisco's reserves scored 19 unanswered points in the second half.
"I thought we did some good things today [Sunday]," Manning said. "We moved the ball pretty well and we got two touchdowns. It would have been nice to get three, had to settle to for a field goal.
"I thought the running game was good. Willis [McGahee] made some nice runs, had some nice holes by the offensive line, the receivers made some nice plays, as well."
In Sunday's other action, the New York Jets again failed to score a touchdown in a 17-12 defeat to the Carolina Panthers at Metlife Stadium.
The Jets have yet to visit the end zone in their three pre-season matches after being restricted to four field goals by the Panthers.
Carolina's starting quarterback Cam Newton hit Louis Murphy for a three-yard touchdown late in the second quarter to give his side a 10-9 lead.
And Newton's back-up Derek Anderson clinched the victory with a one-yard touchdown pass to Gary Barnidge in the fourth quarter.
One dampener for the Panthers was the loss of running back Jonathan Stewart to injury for the second game in a row.
Stewart, who signed a restructured five-year contract earlier in August, was carted back to the locker room in the second quarter after appearing to roll his right ankle. He hurt his left calf during the Panthers' win over the Miami Dolphins last week.
The team later confirmed Stewart's injury as a sprained ankle - an X-ray came back negative - and Panthers head coach Ron Rivera said he will not play in their final pre-season fixture.