This paper considers the localization problem in a 5G-aided global navigation satellite system (GNSS) based on real-time kinematic (RTK) technique. Specifically, the user's position is estimated based on the hybrid measurements, including GNSS pseudo-ranges, GNSS carrier phases, 5G angle-of-departures, and 5G channel delays. The underlying estimation problem is solved by steps that comprise obtaining the float solution, ambiguity resolution, and resolving the fixed solution. The analysis results show that the involvement of 5G observations can enable localization under satellite-deprived environments, inclusive of extreme cases with only 2 or 3 visible satellites. Moreover, extensive simulation results reveal that with the help of 5G observations, the proposed algorithm can significantly reduce the estimation error of the user's position and increase the success rate of carrier-phase ambiguity resolution.