While infant formula is usually bovine milk-based, interest in other ruminant milk-based formulas is growing. However, whether different ruminant milk treatments with varying nutrient compositions influence the infant’s brain development remains unknown. The aim was to determine the effects of consuming bovine, caprine, or ovine milk on brain gene expression in the early postnatal period using a pig model of the human infant. Starting at postnatal day 7 or 8, pigs were exclusively fed bovine, ovine, or caprine milk for 15 days. The mRNA abundance of 77 genes in the prefrontal cortex, hippocampus, and striatum regions was measured at postnatal day 21 or 22 using NanoString. The expression level of two hippocampal and nine striatal genes was most affected by milk treatments, particularly ovine milk. These modulatory genes are involved in glutamate, gamma-aminobutyric acid, serotonin, adrenaline and neurotrophin signaling and the synaptic vesicle cycle. The expression level of genes involved in gamma-aminobutyric acid signaling was associated with pigs’ lactose intake. In contrast, milk treatments did not affect the mRNA abundance of the genes in the prefrontal cortex. This study provides the first evidence of the association of different ruminant milk treatments with brain gene expression related to cognitive function in the first 3 months of postnatal life.