With two outs and none on in the eighth inning, Derek Law allowed a rare home run that put the Pirates ahead and the Giants behind in the West.