It depends on what you mean by talking to deceased loved ones. There are numerous occasions of exorcisms in which the possessed will have knowledge in which there is no explanation for them having it, or another classic characteristic of the possessed to speak in a language that the person does not know. I say this to illustrate how demons know, contain, and are willing to readily share that information if invited to do so. The Catechism says
Necromancy is a special mode of divination by the evocation of the dead.
and notes that divination is
The seeking after knowledge of future or hidden things by inadequate means.
Furthermore the term Necromancy stems from the term Nigromancy from the Italian, Spanish, or old French meaning "black." If you're evoking the dead to obtain knowledge forbidden to the human state, then that in and of itself is an inadequate means in which case you would be engaging in necromancy.
On the contrary, however, we must be careful with the terms we use here. We don't pray to the Saints, we pray for the intercessions of the Saints. Similarly we can pray for deceased loved one's in purgatory, but we don't pray to them per se. The differentiation here comes from the Biblical idea found in Ecclesiastes that
The dead know nothing. (Eccl 9:5)
We have no means of knowing if our loved one's are in Purgatory or not in which case we do know for a fact that they are physically dead and therefore know nothing. In Catholic Tradition we have an empirical means by which we can and have determined whether or not one is in Heaven through the process of Sainthood but that's for another question. In short we can pray for the intercessions of the Saints because they're alive, but not to our deceased loved one's because we don't know and to do so would be superstitious and the means by which you attempt to communicate with the deceased could be considered necromancy. I hoped this helped, great question!