Interesting interview from IGN on how this happened:
https://www.ign.com/articles/2019/03/20/how-an-indie-developer-is-making-an-official-zelda-game
https://www.ign.com/articles/2019/03/20/how-an-indie-developer-is-making-an-official-zelda-game
"We were considering making a new Nintendo Switch project," Clark explained to me "and we imagined how cool it would be to have Zelda characters appearing in NecroDancer; say as DLC." But Nintendo's interest apparently grew beyond a simple DLC. "To our surprise, Nintendo was extremely interested in the prospect, and before we knew it we were working on a completely new title, mashing up NecroDancer with The Legend of Zelda!"
[...]
On Nintendo's side, Scott tells me that "developers are always reaching out to Nintendo to include IP in their games," but clearly something was different this time around. "When you look at a case like Cadence of Hyrule, there's special cases in some instances where our Japan team see content and see titles that they want to work with and [the interest is] a two-way street, really."