Electromagnetic source imaging (ESI) offers unique capability of imaging brain dynamics for studying brain functions and aiding the clinical management of brain disorders. Challenges exist in ESI due to the ill-posedness of the inverse problem and thus the need of modeling the underlying brain dynamics for regularizations. Advances in generative models provide opportunities for more accurate and realistic source modeling that could offer an alternative approach to ESI for modeling the underlying brain dynamics beyond equivalent physical source models. However, it is not straightforward to explicitly formulate the knowledge arising from these generative models within the conventional ESI framework. Here we investigate a novel source imaging framework based on mesoscale neuronal modeling and deep learning (DL) that can learn the sensor-source mapping relationship directly from MEG data for ESI. Two DL-based ESI models were trained based on data generated by neural mass models and either generic or personalized head models. The robustness of the two DL models was evaluated by systematic computer simulations and clinical validation in a cohort of 29 drug-resistant focal epilepsy patients who underwent intracranial EEG (iEEG) evaluation or surgical resection. Results estimated from pre-operative MEG interictal spikes were quantified using the overlap with resection regions and the distance to the seizure-onset zone (SOZ) defined by iEEG recordings. The DL-based ESI provided robust results when no personalized head geometry is considered, reaching a spatial dispersion of 21.90 ± 19.03 mm, sublobar concordance of 83 %, and sublobar sensitivity and specificity of 66 and 97 % respectively. When using personalized head geometry derived from individual patients’ MRI in the training data, personalized DL-based ESI model can further improve the performance and reached a spatial dispersion of 8.19 ± 8.14 mm, sublobar concordance of 93 %, and sublobar sensitivity and specificity of 77 and 99 % respectively. When compared to the SOZ, the localization error of the personalized approach is 15.78 ± 5.54 mm, outperforming the conventional benchmarks. This work demonstrates that combining generative models and deep learning enables an accurate and robust imaging of epileptogenic zone from MEG recordings with strong sublobar precision, suggesting its added value to enhancing MEG source localization and imaging, and to epilepsy source localization and other clinical applications.