Hi Karen you need to find out the underlying issue and reason for the hairloss before giving Melatonin.
Melatonin is used for seasonal flank alopecia which is indeed hair loss and the skin under the hairloss tends to go black. this happens during winter months and they say lack of sunlight causes it.
but there are many other reasons that can cause hairloss such as:
thyroid problems
mange
allergies
please book a visit to the vets where they can check it and do skin scrapes and blood work if needed to rule out other issues