SAN FRANCISCO Matt Cain pitched five shutout innings, then raised his arms and waved his cap, fighting off tears amid a standing ovation as he walked off the mound for final time Saturday in the San Francisco Giants' 3-2 loss to San Diego.