A sexual predator who stalked his victim in the shadows before raping threatening her with a knife has been jailed for more than 20 years.