Tim Lincecum allowed three runs over six plus innings and the Giants avoided a sweep in San Diego with a 4-3 win over the Padres.