Context : The accurate census of galaxies at different epochs since the first galaxies were formed is necessary to make progress in understanding galaxy evolution , including how mass assembly and star formation evolve . Aims : We aim to measure and analyse the redshift distribution N ( z ) of magnitude-selected samples using spectroscopic redshift measurement up to z \simeq 5 . Methods : We use the VIMOS VLT Deep Survey ( VVDS ) final data release on the 0226-04 field , including 10 765 galaxies with spectroscopic redshifts , selected solely on their magnitude 17 \leq i _ { AB } \leq 24.75 , successfully crossing any ’ redshift desert ’ . We compute the redshift distribution N ( z ) and provide reference parametric fits for i - band as well as for J , H and Ks - band magnitude limited samples . The observed galaxy number counts in different redshift domains are compared to other surveys from the literature , as well as to results from semi-analytic models on the Millennium dark matter simulations . Results : The redshift distribution of a sample with i _ { AB } \leq 24 and spectroscopic redshifts has a mean redshift \bar { z } = 0.92 , with 8.2 % of the galaxies with z > 2 . Down to i _ { AB } \leq 24.75 the spectroscopic redshift sample has a mean redshift \bar { z } = 1.15 and 17.1 % of the galaxies are beyond z = 2 . We find that the projected sky density is 2.07 \pm 0.12 galaxies per arcmin ^ { 2 } at 1.4 \leq z \leq 2.5 and Ks _ { AB } \leq 22.5 , 1.72 \pm 0.15 galaxies per arcmin ^ { 2 } at 2.7 \leq z \leq 3.4 and 0.59 \pm 0.09 galaxies per arcmin ^ { 2 } at 3.4 \leq z \leq 4.5 brighter than i _ { AB } = 24.75 ( errors are including Poisson noise and cosmic variance ) . Galaxies at z \sim 3 identified from magnitude-selected samples are 1.5 to 3 times more numerous than when they are colour-colour selected , consistent with the different selection functions . We demonstrate that colour-colour selected samples over 1.4 \leq z \leq 4.5 are strongly contaminated by galaxies at other redshifts . Semi-analytic models on the Millennium simulations are found to under-predict the number of luminous star-forming galaxies at z \gtrsim 1.8 - 2 , as well as to over-predict the number of low-luminosity galaxies at z \lesssim 0.8 . Conclusions : Our study provides comprehensive galaxy number counts N ( z ) from galaxies with spectroscopic redshifts over a large redshift domain 0 \leq z \leq 5 , a solid basis for the measurement of volume-complete quantities . Magnitude-selected surveys identify a higher number of galaxies at z > 2 than in colour-colour selected samples , and we use the magnitude-selected VVDS to emphasize the large uncertainties associated to other surveys using colour or colour-colour selected samples . Our results further demonstrate that semi-analytical models on dark matter simulations have yet to find the right balance of physical processes and time-scales to properly reproduce a fundamental galaxy population property like the observed N ( z ) .