well, i hope you understand that youre asking for outside opinion and you will get a variety of different answers.
now, on one hand, i do not know your full situation. i do not know how close you two are, and what you two have bonded over, and i do not have a full story. in my random internet opinion, i think that is maybe not unethical exactly, but something i would never be able to do from the context you provided. it would cause immense guilt within me. i think it may have been something to think over more, although of course, once again, i do not know the full context, so do not take me as someone judging you.
however, on the other hand, i am slightly hypocritical, and am aware that bonding over this intimacy with death and longing to either help others or to just feel less alone is something easy [although something that can also be toxic]. i planned something long ago with someone who, previous to me bringing it up, was not aware of the specifics of these things. sorry, i am trying to be vague for personal reasons. i recently decided this was a massive mistake on my part and i may have caused someone's life trajectory, no matter how close we were, to shift immensely into a darker place. i have since cut off contact with this individual for their own good, and despite the pain i know i have brought, i feel good about it because i was only leading them further down.
what i am trying to say is that i do not know your story, but if you give this context and ask about it, i will state that it is for sure something to ponder for yourself, with no easy answer. i do not think encouraging death to someone not seeking it out is ethical, however it does not seem that is what you are doing. these are all just thoughts i have had that may help you think more. i hope things go okay for you and your friend.