You needed to force him into the corner(should have used your king a bit more ) eventually you could have left the king with no moves and separated the knight, but with time pressure.... tricky! analize the game, the engine will show you how it's done.
https://www.chess.com/live/game/2114091970