Elderberry (Sambucus nigra L., fructus) is a very potent herbal drug, deriving from traditional European medicine (TEM). Ripe elderberries are rich in anthocyanins, flavonols, flavonol esters, flavonol glycosides, lectins, essential oils, unsaturated fatty acids and vitamins. Nevertheless, unripe elderflower fruits contain a certain amount of sambunigrin, a toxic cyanogenic glycoside, whose concentration decreases in the ripening process. Therefore, quality assurance must be carried out. The standard method described in literature is the photometric determination (pH-differential method) of the total anthocyanin content (TAC) that is the highest when the berries are ripe. The drawback of the pH-differential method is the extensive sample preparation and the low accuracy of the method. Therefore, the goal of this publication was to develop a fast non invasive near-infrared (NIR) method for the determination of TAC in whole berries. TAC of elderberries was measured using pH-differentiation method where TAC values of 632.87 mg/kg to 4342.01 mg/kg were measured. Additionally, cyanidin-3-O-glucoside, cyanidin-3-O-sambubioside and cyanidin-3-O-sambubioside-5-O-glucoside which represent more than 98% of TAC in elderberry were quantified using ultra high performance liquid chromatography-multiple wavelength detection—ultra high resolution-quadrupole-time of flight-mass spectrometry (UHPLC-MWD-UHR-Q-TOF-MS) and their sum parameter was determined, ranging between 499.43 mg/kg and 8199.07 mg/kg. Using those two methods as reference, whole elderberries were investigated by NIR spectroscopy with the Büchi NIRFlex N-500 benchtop spectrometer. According to the constructed partial least squares regression (PLSR) models the performance was as follows: a relative standard deviation (RSDPLSR) of 13.5% and root mean square error of calibration (RMSECV/RMSEC) of 1.31 for pH-differentiation reference and a RSDPLSR of 12.9% and RMSECV/RMSEC of 1.28 for the HPLC reference method. In this study, we confirm that it is possible to perform a NIR screening for TAC in whole elderberries. Using quantum chemical calculations, we obtained detailed NIR band assignments of the analyzed compounds and interpreted the wavenumber regions established in PLSR models as meaningful for anthocyanin content. The NIR measurement turned out to be a fast and cost-efficient alternative for the determination of TAC compared to pH-differential method and UHPLC-MWD-UHR-Q-TOF-MS. Due to the benefit of no sample preparation and extraction the technology can be considered as sustainable green technology. With the above mentioned inversely proportional ratio of TAC to total amount of toxic cyanogenic glycosides, NIR proves to be a reliable screening method for the ideal harvest time with maximal content of TAC and lowest content of cyanogenic glycosides in elderberry.