To provide enhanced mobile services, the 5G system is expected to further densify its network infrastructure and scale up the deployment of massive antenna arrays that emit highenergy beams using the millimeter wave spectrum. These radically new features will significantly impact the EMF exposure level in the 5G networks. In this paper, EMF exposure for 5G mobile networks in a dense urban environment is investigated using a raytracing approach for the uplink (UL) and downlink (DL). A massive multi-input multi-output antenna with multiuser beamforming capability is considered for the 5G base station. For DL, the maximum rate transmission (MRT) technique is used to direct the beams toward all the active users, and total power density (PD) is used to evaluate the EMF exposure level. On the other hand, EMF exposure due to UL is investigated using electric field strength and specific absorption rate (SAR). The proposed ray-tracing based EMF evaluation framework exploits detailed information of the scenarios, including 3D building geometry, EM characteristics, multipath propagation, user locations and beamforming radiation pattern, to effectively evaluate the EMF's spatial variation levels. Following this evaluation procedure, the impact of different user densities and distributions is analyzed in terms of PD and SAR. Results show that for DL, the peak PD increases from 6.65 to 24.92 dBm/m 2 when the number of active users in the area increases from a single user to 100%. Considering the worst-case scenario, the PD exposure reaches 62% of the ICNIRP's limit. Saturation of the spatial EMF distribution occurs when the number of active DL beams is above 25%. For UL, within 5m radius of the user's location, the average E-field may increase from 2.40 to 3.98 V/m. (increment of 66%) if the number of active users in the area increases from 25% to 100%. Moreover, when 100% of the users are actively transmitting, there is only a 10% probability that the SAR may exceed 0.06 W/kg (or 3% of the ICNIRP's limit).