The performance of a range-based indoor positioning system is severely degraded by non-line-of-sight (NLOS) propagation due to the offsets in range measurements (i.e., NLOS errors). It is difficult to predict or mitigate the NLOS errors since they are dependent on both the location and the environment. In this paper, we propose an accurate tracking scheme for NLOS environments by jointly estimating the target's trajectory and the NLOS errors based on the fusion of sensors that measure the motion of the target. We first formulate a maximum a posteriori (MAP) estimation problem with generic equality constraints that capture the spatial correlation of NLOS errors. A specific constraint function based on Gaussian process (GP) regression is then provided, and an iterative algorithm is proposed to solve the optimization problem. The proposed scheme is validated experimentally in an indoor positioning system with 125 MHz bandwidth using a mobile node equipped with an inertial measurement unit. It is shown that the median positioning error in an office environment is reduced by 90% to 11 cm compared to using conventional tracking algorithms.