While electroencephalography (EEG) and magnetoencephalography (MEG) are well-established noninvasive methods in neuroscience and clinical medicine, they suffer from low spatial resolution. Electrophysiological source imaging (ESI) addresses this by noninvasively exploring the neuronal origins of M/EEG signals. Although subcortical structures are crucial to many brain functions and neuronal diseases, accurately localizing subcortical sources of M/EEG remains particularly challenging, and the feasibility is still a subject of debate. Traditional ESIs, which depend on explicitly defined regularization priors, have struggled to set optimal priors and accurately localize brain sources. To overcome this, we introduced a data-driven, deep learning-based ESI approach without the need for these priors. We proposed a four-layered convolutional neural network (4LCNN) designed to locate both subcortical and cortical sources underlying M/EEG signals. We also employed a sophisticated realistic head conductivity model using the state-of-the-art segmentation method of ten different head tissues from individual MRI data to generate realistic training data. This is the first attempt at deep learning-based ESI targeting subcortical regions. Our method showed excellent accuracy in source localization, particularly in subcortical areas compared to other methods. This was validated through M/EEG simulations, evoked responses, and invasive recordings. The potential for accurate source localization of the 4LCNNs demonstrated in this study suggests future contributions to various research endeavors such as the clinical diagnosis, understanding of the pathophysiology of various neuronal diseases, and basic brain functions.