This publication might be useful in your case:
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6764051/
The present study has indicated that after complete excision of the mammary gland, finasteride treatment might not affect the recurrence of gynecomastia; however, additional prospective studies are needed. Surgeons may recommend continuation of finasteride in patients who wish to take it after mastectomy for gynecomastia.
Obviously, talk to your doctor about this.