Aminoacetonitrile, a molecule detected in the interstellar medium only toward the star-forming region Sagittarius B2 (Sgr B2), is considered an important prebiotic species; in particular, it is a possible precursor of the simplest amino acid glycine. To date, observations have been limited to ground state emission lines, whereas transitions from within vibrationally excited states remained undetected. We wanted to accurately determine the energies of the low-lying vibrational states of aminoacetonitrile, which are expected to be populated in Sgr B2(N1), the main hot core of Sgr B2(N). This step is fundamental in order to properly evaluate the vibration-rotation partition function of aminoacetonitrile as well as the line strengths of the rotational transitions of its vibrationally excited states. This is necessary to derive accurate column densities and secure the identification of these transitions in astronomical spectra. The far-infrared ro-vibrational spectrum of aminoacetonitrile has been recorded in absorption against a synchrotron source of continuum emission. Three bands, corresponding to the lowest vibrational modes of aminoacetonitrile, were observed in the frequency region below 500 cm-1. The combined analysis of ro-vibrational and pure rotational data allowed us to prepare new spectral line catalogs for all the states under investigation. We used the imaging spectral line survey ReMoCA performed with ALMA to search for vibrationally excited aminoacetonitrile toward Sgr B2(N1). The astronomical spectra were analyzed under the local thermodynamic equilibrium (LTE) approximation. Almost 11 000 lines have been assigned during the analysis of the laboratory spectrum of aminoacetonitrile, thanks to which the vibrational energies of the $v_{11} = 1$, $v_{18} = 1$, and $v_{17} = 1$ states have been determined. The whole dataset, which includes high $J$ and $K_a$ transitions, is well reproduced within the experimental accuracy. Reliable spectral predictions of pure rotational lines can now be produced up to the THz region. On the basis of these spectroscopic predictions, we report the interstellar detection of aminoacetonitrile in its $v_{11} = 1$ and $v_{18} = 1$ vibrational states toward Sgr B2(N1) in addition to emission from its vibrational ground state. The intensities of the identified $v_{11} = 1$ and $v_{18} = 1$ lines are consistent with the detected $v = 0$ lines under LTE at a temperature of 200 K for an aminoacetonitrile column density of 1.1 × 1017 cm-2. This work shows the strong interplay between laboratory spectroscopy exploiting (sub)millimeter and synchrotron-based far-infrared techniques, and observational spectral surveys to detect complex organic molecules in space and quantify their abundances.