The performance of the traditional direction-of-arrival (DOA) estimation algorithms would deteriorate seriously for closely spaced sources, especially at low SNR. To tackle the accurate DOA estimation for closely spaced sources, the article proposes a new algorithm based on a deep neural network (DNN). The DNN is designed to learn the mapping relationship between signals and their DOAs. In the training process, different low SNR samples will be used to train the neural network. With such a form, the DNN would enhance the robustness of DOA estimation under harsh environments. Simulation results demonstrate that the proposed algorithm outperforms the existing algorithms under challenging scenarios, especially for closely spaced sources at low signal-to-noise ratio (SNR).