The Yankees got the 30-year-old lefty and cash for minor league right-handers Janson Junk and Elvis Peguero.
New York began the day at 53-48, fourth in the AL wild-card race for two spots. As Friday's trade deadline approached, the Yankees got All-Star outfielder Joey Gallo from Texas and star first baseman Anthony Rizzo from the Chicago Cubs.
Heaney was 6-7 with a 5.27 ERA in 18 starts for the Angels this year. He is 30-36 with a 4.57 ERA in eight seasons with Miami and Los Angeles. He posted his first big league win against the Yankees in 2015.
The 25-year-old Junk was 4-1 with a 1.78 ERA at Double-A Somerset. The 24-year-old Peguero was a combined 4-1 with a 2.23 ERA in 21 relief appearances for high-A Hudson Valley and Somerset.