Get to know your religion better first. Start with the oldest texts and testaments, and read them yourself.
See what they say about ghosts and gods and spirits and other entities. And what they don't say.
Then work your way through to the end, see how things change. Think about this.
Finally then, ask a trusted religious figure what they think of ghosts and the like. Don't argue with them, be respectful, and hear all they have to say.
Now, when you have all those perspectives, think long and hard about how they differ and why they might differ. Once you understand how your religion views the supernatural, and how that view gets twisted by time and dogmatic corruption, you will be standing on firm ground as far as assessing whether or not your religion (and not human/political/temporal corruption thereof) has any real concerns with you befriending a spirit.
Or just ask your conscience, and do what you feel in your heart is right.