[S]ymptoms can persist for months or years after stopping the drug.

The Bottom Line: It is important to know that those who experience hair loss are more likely to report depression, so clinical trials are needed to conclusively determine whether finasteride causes depression and anxiety. However, studies have documented depression and anxiety among finasteride patients, along with sexual side effects, and symptoms can persist for months or years after stopping the drug.

Taking Propecia or Proscar to Prevent Hair Loss is Associated with Depression, Anxiety, and Sexual Problems: National Center for Health Research website, 2021