Pre-babbling infants can track nonadjacent dependencies (NADs) in the auditory domain. While this forms a crucial prerequisite for language acquisition, the neurodevelopmental origins of this ability remain unknown. We applied functional near-infrared spectroscopy in neonates and 6- to 7-month-old infants to investigate the neural substrate supporting NAD learning and detection using tone sequences in an artificial grammar learning paradigm. Detection of NADs was indicated by left prefrontal activation in neonates while by left supramarginal gyrus (SMG), superior temporal gyrus (STG), and inferior frontal gyrus activation in 6- to 7-month-olds. Functional connectivity analyses further indicated that the neonate activation pattern during the test phase benefited from a brain network consisting of prefrontal regions, left SMG and STG during the rest and learning phases. These findings suggest a left-hemispheric learning-related functional brain network may emerge at birth and serve as the foundation for the later engagement of these regions for NAD detection, thus, providing a neural basis for language acquisition.