To evaluate the quality of Moyao (Myrrh) in the identification of the geographical origin and processing of the products. Raw Moyao (Myrrh) and two kinds of Moyao (Myrrh) processed with vinegar from three countries were identified using near-infrared (NIR) spectroscopy combined with chemometric techniques. Principal component analysis (PCA) was used to reduce the dimensionality of the data and visualize the clustering of samples from different categories. A classical chemometric algorithm (PLS-DA) and two machine learning algorithms [K-nearest neighbor (KNN) and support vector machine] were used to conduct a classification analysis of the near-infrared spectra of the Moyao (Myrrh) samples, and their discriminative performance was evaluated. Based on the accuracy, precision, recall rate, and F1 value in each model, the results showed that the classical chemometric algorithm and the machine learning algorithm obtained positive results. In all of the chemometric analyses, the NIR spectrum of Moyao (Myrrh) preprocessed by standard normal variation or Multivariate scattering correction combined with KNN achieved the highest accuracy in identifying the geographical origins, and the accuracy of identifying the processing technology established by the KNN method after first-order derivative pretreatment was the best. The best accuracy of geographical origin discrimination and processing technology discrimination were 0.9853 and 0.9706 respectively. NIR spectroscopy combined with chemometric technology can be an important tool for tracking the origin and processing technology of Moyao (Myrrh) and can also provide a reference for evaluations of its quality and the clinical use.