"HAPPY Z DAY," the pop star wrote on Instagram Thursday alongside a blue-colored still image of herself and Malik standing side by side.
The caption is in reference to Malik's 24th birthday.
"Baby, baby, I feel crazy/Up all night, all night and every day/Give me something, oh, but you say nothing/What is happening tonight?" Swift can be heard singing on the track until Malik takes over with "I don't wanna live forever/'Cause I know I'll be living in pain."
According to Malik, the pair came together through his girlfriend Gigi Hadid who is also friends with Swift.
"We were kind of in separate places when I mentioned the idea to [Taylor]," he said. "I spoke to her on the phone, and she heard the song 'cause Jack [Antonoff] played it to her. She really liked it, and she went in the studio the next day."
"The really interesting thing was she's actually friends with [Gigi], so she'd already reached out 'cause Jack had just played her the song anyway," he added.