A Celestial Navigation System (CNS) is a feasible and economical autonomous navigation system for deep-space probes. Ephemeris errors have a great influence on the performance of CNSs during the Mars approach phase, but there are few research studies on this problem. In this paper, the analysis shows that the ephemeris error of Mars is slowly-varying, while the ephemeris error of Phobos and Deimos is periodical. The influence of the ephemeris errors of Mars and its satellites is analysed in relation to both the Sun-centred frame and the Mars-centred frame. The simulations show that the position error of a probe relative to the Sun caused by the Mars ephemeris error is almost equal to the ephemeris error itself, that the velocity error is affected slightly, and that the position and velocity relative to Mars are hardly affected. The navigation result of a Mars probe is also greatly affected by the quantities and periodicities of the ephemeris errors of Phobos and Deimos, especially that of Deimos.