Luis Castillo hit his first homer of the season, a two-run shot into the second deck in left, and Mike Pelfrey worked 7 1/3 solid innings, but it took Daniel Murphy's walk-off single in the bottom of the ninth to seal the victory for the Mets.