Gerrit Cole allowed a pair of unearned first-inning runs before shutting down the San Francisco Giants for the remainder of his seven-inning outing Monday as the Pirates held on for a 4-3 triumph.