Post-surgical survival outcomes in patients with non-small-cell lung cancer (NSCLC) and idiopathic pulmonary fibrosis (IPF) are expected to be worse than those in patients with other idiopathic interstitial pneumonias (IIPs). However, these remain unclear regarding patients with NSCLC and IPF histologically diagnosed as usual interstitial pneumonia [IPF(UIP)]. We aimed to assess the surgical and survival outcomes and identify prognostic factors in patients with NSCLC and IPF(UIP). This retrospective cohort study included patients with pathological stage I-III NSCLC and UIP. Prognostic factors and their association with lung cancer deaths (LCDs) and non-LCDs (NLCDs) were investigated. The overall survival of patients with UIP was significantly poorer than that of others with IIPs. The main causes of death were lung cancer (36%) and respiratory disease (44%). Multivariate analyses revealed the pathological stage of NSCLC ≥ II (hazard ratio [HR], 2.196; p = 0.009) and GAP stage ≥ II (HR, 2.821; p = 0.016) to be significant prognostic factors. NLCD incidence was significantly high in patients with GAP stage ≥ II. Recurrence occurred in 26 patients (36.1%); the period from recurrence to death was shorter in patients with IPF(UIP) than in patients without IPF(UIP). Patients with NSCLC and IPF(UIP) had poor prognosis after surgery. However, the prognosis varied greatly depending on the GAP stage. Considering the difficulty in managing post-surgical recurrence and high incidence of LCDs in patients with IPF(UIP), pursuing a radical resection is recommended in patients with GAP stage I. For patients with GAP stage ≥ II, comprehensive management of UIP is also necessary.