A teenager who seriously injured his victim in an unprovoked knife attack has been jailed for five years.