Frank Gore scored a go-ahead, 1-yard touchdown with 5:47 remaining, Colin Kaepernick threw for a career-high 412 yards and three touchdowns, with 13 completions to Anquan Boldin, and the San Francisco 49ers beat the Green Bay Packers 34-28 on Sunday.