Background: The purpose of this study was to report and compare the surgical outcomes of preterm-related necrotizing enterocolitis (PNEC) and congenital heart disease (CHD)-related necrotizing enterocolitis (CDNEC). Materials and Methods: Preterm infants without CHD and term infants with CHD who developed NEC and needed surgery were included in this cohort study between 2018 and 2021 at our university-affiliated hospital. A board-certified pediatric cardiologist examined all the patients with echocardiographic and cardiac examinations to diagnose CHD, and a pediatric surgeon evaluated the neonates for surgical indications. Patient characteristics, pregnancy history, and surgical and mortality outcomes were collected from the infants’ medical records. Results: Forty infants with NEC were included. The CDNEC and PNEC groups consisted of 18 and 22 infants, respectively. Although the disease-specific mortality rate was higher in the CDNEC group than in the PNEC group, the difference was insignificant (55.5% and 40.9%, respectively, P=0.36). There was no statistically significant difference in the time of NEC occurrence, location, type of surgery, or indications for surgery between the two groups. Conclusion: Despite the pathophysiologies of CDNEC and PNEC being different, the characteristics, pregnancy history, surgical, and mortality outcomes of these two types are similar in infants who undergo surgical treatment.