Which iPhone 5 - from what carrier, and what exact phone model.
There is more ways to get ripped off than if the phone is locked. It can also be blacklisted. It can be locked to an AppleID if the original owner did not remove his or her AppleID before selling (or if it is stolen).
You need to know what you are doing to get used iPhones from online sources. It is not enough to ask or know if it is unlocked.
Only if its factory unlocked. Not from a network like sprint or I believe ATT. (only the iphone 6s from att works).