Nonsteroidal anti-inflammatory drug (NSAID) use may affect ovarian cancer risk via prostaglandin synthesis and tumor-associated macrophage (TAM) infiltration. We evaluated if associations between aspirin or non-aspirin NSAID use and ovarian cancer risk differed by tumor expression of prostaglandin-related (COX1, COX2) and TAM-related (CD68, CD163) markers. We evaluated cases and matched controls from the Nurses' Health Study (NHS), NHSII, and New England Case-Control Study (NECC). Cases with IHC data on COX1 and COX2 (n = 532) or CD68 and CD163 (n = 530) were included. We used polytomous logistic regression, adjusted for ovarian cancer risk factors, to estimate OR for NSAID use and ovarian cancer risk by marker level. Recent aspirin use had a nonsignificant inverse association and recent non-aspirin NSAID use had no association with ovarian cancer risk. NSAID use was not differentially associated with ovarian cancer by COX1 or COX2 expression. However, recent aspirin use was associated with lower ovarian cancer risk for high [OR 0.54; 95% confidence interval (CI), 0.37-0.78], but not low (OR 1.50; 95% CI, 0.97-2.31), CD163 density (P heterogeneity < 0.001). Similar results were observed for aspirin duration and tablets and for recent non-aspirin NSAID use. Results were not clearly different by macrophage density defined by the less specific macrophage marker, CD68. NSAID use was inversely associated with risk of ovarian cancer with high density CD163, a marker for M2-type, immunosuppressive macrophages. However, the relationship did not differ by prostaglandin synthesis markers. Future research should explore prostaglandin-independent mechanisms for the association between NSAID use and ovarian cancer risk, including immune mechanisms.