Hi Samantha & welcome.
First of all, I think you were absolutely right to say that you don't discuss personal matters behind the backs of others.
And I think that you are probably right to tell your friend that this person has been talking / asking about him.
After all, he didn't ask you not to and you didn't say that you wouldn't.
You don't even have to say anything negative about him ~ just that he has been asking questions & seems very interested in your friend; that you didn't answer them, because you don't discuss the private business of others; but that you just think that he should know.
If you don't pass judgements, then they cannot backfire onto you. Just give the facts.
Good luck.