Take your hamster to a qualified exotics vet (one who specialises in small animals) for a thorough, proper diagnosis. It could be an isolated sore that requires only some antiseptic treatment, but it might also be mites or a fungal infection.
If the sore is large, you need to take him to the vet. It may require surgery if it is infected. At the very least, he will prescribe betadine. You will also likely have to keep the cage cleaner to avoid this happening again.
You can use neosporin on it; this will be fine. There is also a yellow salve they use for horses; this was very effective on the places that my guinea pig had, but so not use too much as I am not sure how it will effect such a small animal.