I think your question should be like this: I have 2 computers 5km away from each other how do I connect them together?
Well that depends on what do you want to use this connection for and the budget and the geographical situation.
5km is a long distance if you are very rich you can use fiber optic cables to connect them however it's hard to implement.
Your best way is to just connect through the Internet.