Yes, it is provable in Rocq :
From Stdlib Require Export Eqdep. Lemma example3 (n n' : nat) : @existT Set (fun x => x) nat n = @existT Set (fun x => x) nat n' -> n = n'. Proof. apply inj_pair2. Qed.