We report on the injection locking of an optically levitated nanomechanical oscillator (a silica nanosphere) to resonant intensity modulations of an external optical signal. We explore the characteristic features of injection locking in this system, e.g. the phase pull-in effect and the injection-induced reduction of the oscillation linewidth. Our measurements are in good agreement with theoretical predictions and deepen the analogy of injection locking in levitated optomechanical systems to that in optical systems (lasers). By measuring the force noise of our feedback cooled free-running oscillator, we attain a force sensitivity of $sim23~rm{zN}/sqrt{rm{Hz}}$. This can readily allow, in fairly short integration times, for tests of violations of Newtonian gravity and searching for new small-scale forces. As a proof of concept, we show that the injection locking can be exploited to measure the forces optically induced on levitated nanoparticles, with potential applications in explorations of optical binding and entanglement between optically coupled nanomechanical oscillators.