We study a random walk pinning model, where conditioned on a simple random walk Y on ℤd acting as a random medium, the path measure of a second independent simple random walk X up to time t is Gibbs transformed with Hamiltonian −Lt(X, Y), where Lt(X, Y) is the collision local time between X and Y up to time t. This model arises naturally in various contexts, including the study of the parabolic Anderson model with moving catalysts, the parabolic Anderson model with Brownian noise, and the directed polymer model. It falls in the same framework as the pinning and copolymer models, and exhibits a localization-delocalization transition as the inverse temperature β varies. We show that in dimensions d=1, 2, the annealed and quenched critical values of β are both 0, while in dimensions d≥4, the quenched critical value of β is strictly larger than the annealed critical value (which is positive). This implies the existence of certain intermediate regimes for the parabolic Anderson model with Brownian noise and the directed polymer model. For d≥5, the same result has recently been established by Birkner, Greven and den Hollander [Quenched LDP for words in a letter sequence (2008)] via a quenched large deviation principle. Our proof is based on a fractional moment method used recently by Derrida et al. [Comm. Math. Phys. 287 (2009) 867–887] to establish the non-coincidence of annealed and quenched critical points for the pinning model in the disorder-relevant regime. The critical case d=3 remains open.