Encarnacion, 36, leads the American League with 21 home runs this season. He has a .241 average and 49 RBIs in 65 games.
The Yankees traded 19-year-old pitcher Juan Then to Seattle. The Mariners traded Then to New York in 2017.
Encarnacion is a career .263 hitter with 401 home runs and 1,205 RBIs in 15 Major League seasons. He has hit 284 home runs since the beginning of the 2012 season.
Yankees pitcher J.A. Happ played with Encarnacion in Toronto. Happ said the three-time All-Star will be a perfect fit in the Yankees' clubhouse.
"He doesn't say a lot, but he works hard and he's prepared," Happ said. "Those are some of the reasons I think he's going to really enjoy it here."
New York entered play Sunday with a 42-27 record. The Yankees have a half-game lead over the Tampa Bay Rays for first place in the AL East Division.