The development of an early complex gut microbiota may play an important role in the protection against intestinal dysbiosis later in life. The significance of the developed microbiota for gut barrier functionality upon interaction with pathogenic or beneficial bacteria is largely unknown. The transcriptome of differently perfused jejunal loops of 12 caesarian-derived pigs, neonatally associated with microbiota of different complexity, was studied. Piglets received pasteurized sow colostrum at birth (d0), a starter microbiota (Lactobacillus amylovorus (LAM), Clostridium glycolicum, and Parabacteroides) on d1-d3, and a placebo inoculant (simple association, SA) or an inoculant consisting of sow’s diluted feces (complex association, CA) on d3-d4. On d 26–37, jejunal loops were perfused for 8 h with either enterotoxigenic Escherichia coli F4 (ETEC), purified F4 fimbriae, LAM or saline control (CTRL). Gene expression of each intestinal loop was analyzed by Affymetrix Porcine Gene 1.1_ST array strips. Gene Set Enrichment Analysis was performed on expression values. Compared to CTRL, 184 and 74; 2 and 139; 2 and 48 gene sets, were up- and down-regulated by ETEC, F4 and LAM, respectively. ETEC up-regulated networks related to inflammatory and immune responses, RNA processing, and mitosis. There was a limited overlap in up-regulated gene sets between ETEC and F4 fimbriae. LAM down-regulated genes related to inflammatory and immune responses, as well as to cellular compound metabolism. In CA pigs, 57 gene sets were up-regulated by CA, while 73 were down-regulated compared to SA. CA up-regulated gene sets related to lymphocyte modulation and to cellular defense in all loop perfusions. In CA pigs, compared to SA pigs, genes for chemokine and cytokine activity and for response to external stimuli were down-regulated in ETEC-perfused loops and up-regulated in CTRL. The results highlight the importance of the nature of neonatal microbial colonization in the response to microbial stimuli later in life.