As the mobile communication network evolves over the past few decades, localizing user equipment (UE) has become an important network service. While localization in line-of-sight (LoS) scenarios has reached a level of maturity, it is known that in far-field scenarios without a LoS path nor any prior information about the scatterers, accurately localizing the UE is impossible. In this letter, we show that this becomes possible if there are scatterers in the near-field region of the base station (BS) antenna arrays. Specifically, by exploiting the additional distance sensing capability of extremely large-scale antenna arrays (XL-arrays) provided by near-field effects, we propose a novel method that simultaneously performs environment sensing and non-line-of-sight (NLoS) UE localization using one single BS. In the proposed method, the BS leverages the near-field characteristics of XL-arrays to directly estimate the locations of the near-field scatterers with array signal processing, which then serves as virtual anchors for UE localization. Then, the propagation delay for each path is estimated and the position of the UE is obtained based on the positions of scatterers and the path delays. Simulation results demonstrate that the proposed method achieves superior accuracy and robustness with similar complexity compared with benchmark methods.