It is the person or people who are important to us that really matters. It is these people that we want to be with, and we can overcome our loniliness only when they are around.
And it's not just their presence that can cure our loniliness. It's their attention and interaction with us that is important.