All perfect praise be to Allah, the Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad is His slave and Messenger.
Poetry is permissible if it is about a permissible meaning. Its ruling is the ruling of speech; good speech is good, and evil speech is evil.
In poetry, it is permissible to use metaphors, words to indicate something different from the literal meaning, to use a word figuratively, and other things that are widely used in poetry, and the poets used them without any one denouncing them for it.
It appears that what you asked about is among these permissible metaphors, Allah willing, provided that the topic addressed by the poem is good as we mentioned.
You do not have to make it clear to the audience that you are talking about someone else or that you do not mean yourself by what you write because of what we have mentioned, that poetry is a broad field and that it is easy to use figures of speech in it.
Allah knows best.