Managing electric vehicles (EVs) charging activities when the power grid is congested is a challenging task. This article proposes a dynamic, real-time, demand-influenced energy pricing mechanism to accurately allocate fairness to the billing strategy of the EVs charging process. The proposed mechanism is based on the concept of the inverse-demand function to reflect instantaneous energy prices following the microgrids’ real-time energy supply. It comprises two pricing fractions: retail energy price representing the energy cost for non-EVs demand during peak hours, and congested energy price allocated for billing EVs charging events during congested timeslots. The proposed methodology is implemented in a hierarchal multiagent architecture with an optimal energy management system to provide a cost-efficient microgrid operation. The input to the optimization problem is stochastic models that represent day-ahead photovoltaic (PV) production forecast, EVs energy levels, and connectivity times’ prediction models based on a discrete-time Markov chain. Additionally, a predictive model of daily load is also proposed based on adaptive artificial neural networks. The aforementioned models utilized historical data for Miami-Dade County, South Florida. Through numerical simulations, we attest that the proposed pricing mechanism achieves significant energy price reduction for non-EVs consumers when compared with results from previously published pricing policies.