The victory was clinched when Patrick Surtain, who also had a fumble recovery, recovered an onside after the 49ers scored a late touchdown.
That capped an absolutely wild fourth quarter during which the teams combined for 31 points.
The Dolphins entered leading 7-3 thanks to A.J. Feeley's 25-yard touchdown pass to Chris Chambers in the first quarter, a score that came right after Feeley had to go to the sideline to get his dislocated middle finger popped back into place.
San Francisco took the lead when Derek Smith fell on Travis Minor's fumble and then got up and raced 49 yards for a touchdown.
Surtain's fumble recovery later set up the go-ahead touchdown, a 15-yard pass from Feeley to Randy McMichael on third-and-goal. That came after the Dolphins had backpedaled after having first-and-goal at the 1.
That set the stage for the big play, Pope's touchdown after Taylor knocked the ball out of Tim Rattay's hand in the end zone.
Pope was in the game because Zach Thomas only lasted a series because his injured hamstring started acting up.