We present the first detection of N2H+ towards a low-mass protostellar outflow, namely the L1157-B1 shock, at about 0.1 pc from the protostellar cocoon. The detection was obtained with the IRAM 30-m antenna. We observed emission at 93 GHz due to the J = 1-0 hyperfine lines. The analysis of the emission coupled with the HIFI CHESS multiline CO observations leads to the conclusion that the observed N2H+(1-0) line originates from the dense (> 10^5 cm-3) gas associated with the large (20-25 arcsec) cavities opened by the protostellar wind. We find a N2H+ column density of few 10^12 cm-2 corresponding to an abundance of (2-8) 10^-9. The N2H+ abundance can be matched by a model of quiescent gas evolved for more than 10^4 yr, i.e. for more than the shock kinematical age (about 2000 yr). Modelling of C-shocks confirms that the abundance of N2H+ is not increased by the passage of the shock. In summary, N2H+ is a fossil record of the pre-shock gas, formed when the density of the gas was around 10^4 cm-3, and then further compressed and accelerated by the shock.