The 27-year-old right-hander had a 4.75 ERA and no record in 25 relief appearances for the Mets last year, when he was sidelined for a month because of a virus and abscess. He was 1-2 with a 4.31 ERA in 54 games with the Mets over the past two seasons.
He was designated for assignment by the Mets on Dec. 15 and obtained by the Yankees four days later for cash. The Yankees designated him for assignment on Jan. 13.
The trade was announced Tuesday.