Necrotizing enterocolitis (NEC) in preterm neonates is dependent on bacterial colonization, but it remains unclear whether a particular microbiota or specific pathogens are involved. We hypothesized that gut colonization differs between preterm and term neonates and that overgrowth of Clostridium perfringens predisposes to NEC. By using terminal-RFLP and FISH, we characterized the gut microbiota of preterm, caesarean-delivered, formula-fed pigs (n = 44) with or without NEC and of formula- or colostrum-fed term, and vaginally born pigs (n = 13). A different microbiota with high C. perfringens abundance was observed in preterm pigs with NEC compared with healthy individuals. However, immunization against C. perfringens toxins did not prevent NEC, and C. perfringens inoculation (3.6 × 10 cfu/d) failed to induce NEC (n = 16), whereas prophylactic broad-spectrum antibiotics treatment prevented NEC (n = 24). Colonization in both groups of term pigs differed from preterm pigs and was dominated by Lactobacilli spp. In conclusion, gestational age (GA) and NEC influence neonatal gut colonization, whereas diet has minor effects. C. perfringens is more abundant in pigs with NEC but rather as a consequence than a cause of disease. The general bacterial load and underdeveloped gut immune responses in preterm neonates seem more important for NEC development than specific pathogens.