Pitching prospect Frank German is also going to the Red Sox, while New York will either receive a player to be named later or cash considerations in the deal.
The Yankees will send Boston $850,000 as part of the trade, according to MLB.com's Mark Feinsand. Ottavino, who's set to make $9 million in 2021, is in the last year of a three-year, $27-million contract.
Ottavino, 35, struggled last season but was lights out in 2019, posting a 1.90 ERA with 88 strikeouts in 66 1/3 innings.
German was the Yankees' No. 24-ranked prospect in 2020, according to MLB Pipeline. The 23-year-old right-hander has never pitched above Single-A.