The dead (and Elijah who was taken alive to heaven) are sometimes directly addressed in Sacred Scripture in ways that do not involve necromancy or mediums, similar to the way the angels are directly addressed in Psalm 103:20; 148:2;
Daniel 3:58 NABRE:
And David lamented with this lamentation over Saul and Jonathan his son, and he said it should be taught to the people of Judah; behold, it is written in the Book of Jashar. He said: . . . “Jonathan lies slain upon thy high places. I am distressed for
you, my brother Jonathan; very pleasant have
you been to me; your love to me was wonderful, passing the love of women.” (2 Samuel 1:17-18, 25b-26)
And the king lamented for Abner, saying, “Should Abner die as a fool dies? Your hands were not bound, your feet were not fettered; as one falls before the wicked
you have fallen.” (2 Samuel 3:33-34)
And the king was deeply moved, and went up to the chamber over the gate, and wept; and as he went, he said, “
O my son Absalom, my son, my son Absalom! Would I had died instead of
you, O Absalom, my son, my son!” (2 Samuel 18:33)
Spirits and souls of the just, bless the Lord; praise and exalt him above all forever.(Daniel 3:86 NABRE )
How wise
you [Solomon] became in your youth!
You overflowed like a river with understanding. Your soul covered the earth, and
you filled it with parables and riddles. Your name reached to far-off islands, and
you were loved for your peace. For your songs and proverbs and parables, and for your interpretations, the countries marveled at
you. In the name of the Lord God, who is called the God of Israel,
you gathered gold like tin and amassed silver like lead. But
you laid your loins beside women, and through your body
you were brought into subjection.
You put a stain upon your honor, and defiled your posterity, so that
you brought wrath upon your children and they were grieved at your folly, so that the sovereignty was divided and a disobedient kingdom arose out of Ephraim. (Sirach 47:14-21)
How glorious
you were,
O Elijah, in your wondrous deeds! And who has the right to boast which
you have?
You who raised a corpse from death and from Hades, by the word of the Most High; who brought kings down to destruction, and famous men from their beds; who heard rebuke at Sinai and judgments of vengeance at Horeb; who anointed kings to inflict retribution, and prophets to succeed
you.
You who were taken up by a whirlwind of fire, in a chariot with horses of fire;
you who are ready at the appointed time, it is written, to calm the wrath of God before it breaks out in fury, to turn the heart of the father to the son, and to restore the tribes of Jacob. Blessed are those who saw
you, and those who have been adorned in love; for we also shall surely live. (Sirach 48:4-11)