Vacuum ultraviolet (VUV) photodissociation of N2 molecules is a source of reactive N atoms in the interstellar medium. In the energy range of VUV optical excitation of N2, the N-N triple bond cleavage leads to three types of atoms: ground-state N(4S) and excited-state N(2P) and N(2D). The latter is the highest reactive and it is believed to be the primary participant in reactions with hydrocarbons in Titan's atmosphere. Experimental studies have observed a non-monotonic energy dependence and non-statistical character of the photodissociation of N2. This implies different dissociation pathways and final atomic products for different wavelength regions in the sunlight spectrum. We here apply ab initio quantum chemical and nonadiabatic quantum dynamical techniques to follow the path of an electronic state from the excitation of a particular singlet 1Σ+u and 1Πu vibronic level of N2 to its dissociation into different atomic products. We simulate dynamics for two isotopomers of the nitrogen molecule, 14N2 and 14N15N for which experimental data on the branching are available. Our computations capture the non-monotonic energy dependence of the photodissociation branching ratios in the energy range 108 000-116 000 cm-1. Tracing the quantum dynamics in a bunch of electronic states enables us to identify the key components that determine the efficacy of singlet to triplet population transfer and therefore predissociation lifetimes and branching ratios for different energy regions.