Madison Bumgarner scattered four hits over seven innings, Hunter Pence hit a two-run homer and the San Francisco Giants ended their longest losing streak in three years with a 5-2 victory over the Colorado Rockies on Sunday.