We report the first detection in the interstellar medium of N-cyanomethanimine (H2CNCN), the stable dimer of HCN of highest energy and the most complex organic molecule identified in space containing the prebiotically relevant NCN backbone. We have identified a plethora of a-type rotational transitions with 3 ≤ J
up ≤ 11 and K
a ≤ 2 that belong to this species toward the Galactic center G+0.693-0.027 molecular cloud, the only interstellar source showing the three cyanomethanimine isomers (including the Z- and E-isomers of C-cyanomethanimine, HNCHCN). We have derived a total column density for H2CNCN of (2.9 ± 0.1) × 1012 cm−2, which translates into a total molecular abundance with respect to H2 of (2.1 ± 0.3) × 10−11. We have also revisited the previous detection of E- and Z-HNCHCN and found a total C/N-cyanomethanimine abundance ratio of 31.8 ± 1.8 and a Z/E-HNCHCN ratio of 4.5 ± 0.2. While the latter can be explained on the basis of thermodynamic equilibrium, chemical kinetics are more likely responsible for the observed C/N-cyanomethanimine abundance ratio, where the gas-phase reaction between methanimine (CH2NH) and the cyanogen radical (CN) arises as the primary formation route.