This paper presents a learning-based approach for Direction of Arrival (DoA) estimation using a Reconfigurable Intelligent Surface (RIS) in a Non-Line-of-Sight (NLoS) scenario. The key innovation is the employment of a novel Neural Network (NN)-based fully connected layer, referred to as the NN-based RIS layer, within a generic Multi-Layer Perceptron (MLP) structure. The NN-based RIS layer is designed to learn the optimal RIS phase shifts that are tailored for the DoA estimation task. To achieve this, the pre-processed real-valued observations are fed into the RIS layer, which has a specialized structure. Unlike regular neural network layers, the weights of the NN-based RIS layer are constrained to be sinusoidal functions, with the phase arguments being the tunable parameters during the training process. This allows the layer to emulate the functionality of an RIS. Accordingly, the standard feed-forward and back-propagation procedures are modified to accommodate the unique structure of the NN-based RIS layer. Numerical simulations demonstrate that the proposed machine learning-based approach outperforms conventional non-learning-based methods for DoA estimation under almost every practical SNR range in an RIS-assisted scheme.