Inclusion Criteria:
* Biopsy-proven KS involving skin with or without visceral involvement either newly diagnosed or refractory to or intolerant of one or more prior therapies.
* Patients must have cutaneous lesion(s) amenable to six total biopsies (minimum size of biopsy to be 4 mm), either six lesions \> 4 mm or one large lesion measuring 20 mm that can undergo serial biopsy, and at least five additional lesions measurable for assessment with no improvement over the past month.
* Hemoglobin ≥ 8 g/dL (within three months prior to study entry)
* Absolute neutrophil count (ANC) ≥ 1,000 cells/mm\^3 (within three months prior to study entry)
* Platelet count ≥ 100,000/mm\^3 (within three months prior to study entry)
* Calculated (method of Cockcroft-Gault) creatinine clearance (CrCl) ≥ 60 mL/min (within three months prior to study entry) (CrCl may also be obtained by the 24-hour collection method at the investigator's discretion)
* Total bilirubin should be ≤ 1.5x upper limit of normal (ULN) (within three months prior to study entry). If, however, the elevated bilirubin is felt to be secondary to atazanavir therapy, patients will be allowed to enroll on protocol if the total bilirubin is ≤ 3.5 mg/dL provided that the direct bilirubin is normal
* Aspartate aminotransferase (AST) (serum glutamic oxaloacetic transaminase \[SGOT\]) and alanine aminotransferase (ALT) (serum glutamic pyruvate transaminase \[SGPT\]) ≤ 3x ULN (within three months prior to study entry)
* Life expectancy ≥ 3 months.
* Ability and willingness to give informed consent.
* Females of childbearing potential (FCBP) must have a negative serum or urine pregnancy test defined as serum Estradiol (E2) \> 30 pg/mL, a serum follicle stimulating hormone (FSH) \< 40 mIU/L (measured on Day 3 in regularly menstruating females and age-matched), within 10-14 days prior and again within 24 hours of starting nirogacestat. FCBP must either commit to continued abstinence from heterosexual intercourse or the use of two acceptable methods of birth control, one highly effective method except oral contraceptives and one additional effective method at the same time , at the start of therapy to 7 days after discontinuation of nirogacestat, inclusive. Females and males of reproductive potential will be advised to use effective contraception during treatment with nirogacestat and for 7 days after the last dose. FCBP must also agree to ongoing pregnancy testing. Men must agree to use a latex condom during sexual contact with a FCBP even if they have had a successful vasectomy. All patients must be counseled at a minimum of every 28 days about pregnancy precautions and risks of fetal exposure. Patients must, in the opinion of the investigator, be capable of complying with the protocol.
* A female of childbearing potential is a sexually mature female who: 1) has not undergone a hysterectomy or bilateral oophorectomy; or 2) has not been naturally postmenopausal for at least 24 consecutive months (i.e., has had menses at any time in the preceding 24 consecutive months).
* All patients with HIV must be on antiretroviral therapy (ART) for HIV infection with CD4 count \> 50/mm\^3 and viral load \< 200 copies/mL. Patients must be on a stable regimen for at least 12 weeks prior to study entry. Patients may receive any Food and Drug Administration (FDA) approved ART except for zidovudine or protease inhibitors.
* There should be no evidence for improvement in KS in the 3 months prior to study entry for all participants, unless there is evidence for progression of KS in the 4 weeks immediately prior to study entry.
* If antiretroviral regimen contains zidovudine, efavirenz, etravirine, or protease inhibitors and viral load is suppressed (as measured by HIV viral load ≤ 200/mL), then ART must be adjusted to a less toxic therapy not containing these antivirals and enrollment may proceed without waiting 12 weeks. If on antiviral therapy with zidovudine, efavirenz, etravirine, or protease inhibitors, and viral load is not suppressed (as measured by HIV viral load ≥ 200/mL), then ART must be adjusted to a less toxic regimen allowing for optimal viral suppression and must demonstrate stability for at least 12 weeks prior to study entry.
* If HIV positive, documentation of HIV-1 or HIV-2 infection by means of any one of the following:
* Documentation of HIV diagnosis in the medical record by a licensed health care provider.
* Documentation of receipt of ART (at least two different medications that do not constitute a prescription for pre-exposure prophylaxis) by a licensed health care provider. Documentation may be a record of an ART prescription in the participant's medical record, a written prescription in the name of the participant for ART, or pill bottles for ART with a label showing the participant's name.
* HIV-1 ribonucleic acid (RNA) detection by a licensed HIV-1 RNA assay demonstrating \> 200 RNA copies/mL.
* Any licensed HIV screening antibody and/or HIV antibody/antigen combination assay confirmed by a second licensed HIV assay such as an HIV-1 Western blot confirmation or HIV rapid multi-spot antibody differentiation assay.
* Age ≥ 18 years. No dosing or adverse event (AE) data are currently available on the use of nirogacestat in participants \< 18 years of age; children are excluded from this study.
* Eastern Cooperative Oncology Group (ECOG) performance status ≤ 2 (Karnofsky ≥ 60%).
* Participants with known history or current symptoms of cardiac disease or history of treatment with cardiotoxic agents should have a clinical risk assessment of cardiac function using the New York Heart Association Functional Classification within 3 months before study enrollment. To be eligible for this trial, participants must be Class II or better within 3 weeks before enrollment.
Exclusion Criteria:
* Concurrent, acute, active opportunistic infection other than oral thrush or genital herpes within 14 days of enrollment.
* Patients for whom front-line cytotoxic therapy is indicated (i.e., symptomatic visceral or pulmonary KS or symptomatic KS impairing functional status).
* Concurrent neoplasia requiring cytotoxic therapy.
* Anti-neoplastic treatment for KS (including chemotherapy, radiation therapy, local therapy including topical 5-FU, biological therapy, or investigational therapy) within four weeks of study entry.
* Any ongoing glucocorticoid treatment (within last three months, lasting longer than 14 days) except for that required for replacement therapy in adrenal insufficiency or inhaled glucocorticoids for the treatment of asthma.
* Any steroid treatment with equivalent of more than 10 mg prednisone/day lasting longer than 14 days in the last 3 months.
* Patient is ≤ 2 years free of another primary malignancy. Exceptions include the following:
* Basal cell skin cancer.
* Cervical carcinoma in situ.
* Anal carcinoma in situ.
* Previous local therapy of any KS-indicator lesion unless the lesion has clearly progressed since treatment. Any prior local treatment to indicator lesions regardless of the elapsed time should not be allowed unless there is evidence of clear-cut progression of said lesion.
* Use of any investigational drug or treatment within four weeks prior to enrollment.
* Physical or psychiatric conditions that in the estimation of the investigator place the patient at high risk of toxicity or non-compliance.
* Female patients who are pregnant, lactating, or breast-feeding.
* Patients requiring blood transfusions to maintain hemoglobin eligibility.
* Patients currently receiving zidovudine, protease inhibitors, efavirenz, etravirine, ketoconazole, itraconazole, erythromycin, clarithromycin, dexamethasone, phenobarbital, rifampin, phenytoin, carbamazepine, rifabutin, rifapentine, St John's Wort, tacrolimus, cyclosporine, oral contraceptives, warfarin, docetaxel, sirolimus, or other inhibitors or inducers of CYP3A4 or substrates of CYP3A4 that have a narrow therapeutic margin.
* Patients with CD4 \< 50 mm\^3 and/or viral load ≥ 200 copies/mL.
* HIV+ patients with corrected QT interval by Fridericia's formula (QTcF) \> 480 ms.