Necrotizing enterocolitis (NEC) is the leading cause of death caused by gastrointestinal disease in preterm infants. Major risk factors include prematurity, formula feeding, and gut microbial colonization. Microbes have been linked to NEC, yet there is no evidence of causal species, and select probiotics have been shown to reduce NEC incidence in infants. In this study, we evaluated the effect of the probioticBifidobacterium longumsubsp.infantis(BL. infantis), alone and in combination with a human milk oligosaccharide (HMO)—sialylactose (3′SL)—on the microbiome, and the incidence of NEC in preterm piglets fed an infant formula diet. We studied 50 preterm piglets randomized between 5 treatments: (1) Preterm infant formula, (2) Donor human milk (DHM), (3) Infant formula + 3′SL, (4) Infant formula +BL. infantis, and (5) Infant formula andBL. infantis+ 3′SL. NEC incidence and severity were assessed through the evaluation of tissue from all the segments of the GI tract. The gut microbiota composition was assessed both daily and terminally through 16S and whole-genome sequencing (WGS) of rectal stool samples and intestinal contents. DietaryBL. infantisand 3′SL supplementation had no effect, yet DHM significantly reduced the incidence of NEC. The abundance ofBL. infantisin the gut contents negatively correlated with disease severity.Clostridium sensu stricto 1andClostridium perfringenswere significantly more abundant in NEC and positively correlated with disease severity. Our results suggest that pre- and probiotics are not sufficient for protection from NEC in an exclusively formula-based diet. The results highlight the differences in microbial species positively associated with both diet and NEC incidence.