Sanchez helps Pirates rally for win over Mets