You are having hyperpigmentation due to the Niacinamide ointment.
Do not use it any more.
For the black spots your can use the following OTC ointments:
2% Hydroquinone ointments: apply twice daily
Botanicals: ointments containing plant based extracts like Kojic acid and Arbutin
Discuss with your pharmacist about these ointments, you can use any one from among these as different ointments are better suited to different skins, choose the one that suits you most.
You should also follow a good skin care regime. At night, first clean your face with soap and water. Apply an astringent. Then apply the acne medicine. Lastly apply a moisturizer gently. Follow this every night. This will help you greatly.
Also take precautions to avoid the sun. Avoid going out into the sun as far as possible. When you have to go out, use sunscreens with minimum SPF of 50% and wear a cap with peak or a wide brimmed hat.
However if this does not work you need to see a dermatologist for prescription strength ointments. You can also consult a laser clinic for light therapy with lasers.
Hopefully this will solve your problem. I do hope I was able to help you in resolving this issue. If you need more help, please let me know so l can continue to assist you.
Thank you and I wish you the best of health - stay safe!
Dr. P. Jyoti