David Bowie never appeared in a Disney film during his lifetime, but he makes an appearance of sorts in Moana. One of the new Disney adventure’s big musical numbers takes place under the sea, where a greedy crab named Tamatoa sings about his love of all things “Shiny.” Bowie fans will recognize the song (written by Hamilton composer Lin-Manuel Miranda) as an affectionate homage to the glam-rock legend, who passed away from cancer in January at the age of 69. Tamatoa is voiced by Jemaine Clement, half of the New Zealand comedy-folk duo Flight of the Conchords and a man known for his spot-on Bowie impression. But he didn’t know when he signed on for Moana that he’d be channeling the Thin White Duke.

Related: Why ‘Moana’ Is the Movie We Need Right Now

“That was Lin’s idea,” Clement told Yahoo Movies on the phone from Sydney on Tuesday, shortly before his appearance at the ARIA Awards . “If you hear Lin’s demo [of “Shiny”], which is on the soundtrack, you can tell that he’s doing an impression of my impression of David Bowie.”

Listen to Jemaine Clement perform the song ‘Shiny’ from ‘Moana:’

Miranda, who has called “Shiny” his favorite Moana song, wrote it specifically for fellow Bowie fan Clement — though Clement didn’t actually listen to it until right before his recording session. “I didn’t realize they had sent me a [song] file,” he confessed with a laugh. “And [when I heard it] I went, ‘Oh, this is tricky!’”

During the recording session at Walt Disney Studios in Burbank, Miranda chimed in via Skype from New York where he was still performing on Broadway in Hamilton. It wasn’t the first time the two had met: Back in 2004, Miranda’s rap group Freestyle Love Supreme opened for Flight of the Conchords at the Aspen Music Festival. “I had no idea he was going to be the Lin Manuel-Miranda that we know today,” said Clement. “I have a memory of watching their show, and him incorporating Flight of the Conchords into the lyrics of the song he was singing.”

View photos

Clement invented his crustacean character over the course of two studio sessions, which included plenty of improvisation. “[In the film] there’s a mention of me eating my grandma,” Clement recalled. “So I riffed a lot on, ‘I was just saying that to be scary! I wouldn’t really do that to my grandma!’ Because he’s not totally evil, Tamatoa.” Clement added that his character’s hilarious end-credits cameo, which references another famous Disney crab, was written by the screenwriters.

Though Clement is used to being asked to do Bowie — or in his modest words, “what I would say is not a very accurate David Bowie impression” — the gag has taken on a different meaning since the singer’s death. “When Bret [McKenzie] and I did the Conchords on tour this year, the first time that we sang our Bowie song after he died, I found myself very emotional about it, thinking that he’d gone. Singing ‘Bowie’s in Space’ — it felt like a different meaning.”

Clement is particularly excited to show his Moana performance to his Disney-loving eight-year-old son, although he acknowledges that the sight of his dad playing animated antagonists (including an evil cockatoo in Rio and an evil giant in The BFG) has become familiar. “He’s a little offended at this point,” Clements said. “Like, ‘You’re not bad, Dad! Why are you always a bad guy?’ I’m not sure what to tell him about that!”

Watch Dwayne Johnson describe singing for Lin-Manuel Miranda: