At contact distance, I would try to disarm him. First of all, I would fake compliance and try to catch him off guard. You need to remember that a gun is only dangerous in one vector. If I could control his gun hand and grab my knife,
I fail to see why you would opt for your knife in this scenario instead of a gun. If you are in control of his gun hand and have the time to draw your blade why wouldn't you draw your gun and end it quickly and violently?
I carry a knife all the time, mainly for it's utility, but would only go to it first if there was no way to go for my gun. If I am already at gun point, and decide to resist, then I will try for the gun not the knife.