Other medications that can cause gynecomastia include:  Certain heart medications. Certain steroids. Ulcer medications.