For a 5 hour layover, I wouldn't leave the airport assuming you are Int'l-Int'l connection. You will possibly have a long immigration line inbound, be subject to a airport departure fee to go back to the gates, etc. I don't know how bad that departure passport control is at that hour. Others can chime in. Your maximum "enjoyment" time would be about maximum 2 hours, not 3.
5 Hours - less:
1 Hour minimum - immigration each direction + security
45 minutes - at gate prior to departure
1:30 - transit time roundtrip, unless you were somewhere near the airport, which unless you have a specific recommendation, I wouldn't recommend (I wouldn't cut it any closer, "just in case.")