A small fraction of quasars show an unusually high nitrogen-to-carbon ratio (N/C) in their spectra. These "nitrogen-rich" (N-rich) quasars are a long-standing puzzle because their interstellar medium implies stellar populations with abnormally high metallicities. It has recently been proposed that N-rich quasars may result from tidal disruption events (TDEs) of stars by supermassive black holes. The rapid enhancement of nitrogen and the depletion of carbon due to the carbon–nitrogen–oxygen cycle in supersolar mass stars could naturally produce high N/C. However, the TDE hypothesis predicts that the N/C should change with time, which has never hitherto been observed. Here we report the discovery of the first N-rich quasar with rapid N/C variability that could be caused by a TDE. Two spectra separated by 1.7 years (rest-frame) show that the N iii] λ1750/C iii] λ1909 intensity ratio decayed by ~86% ± 14% (1σ). Optical (rest-frame UV) light-curve and X-ray observations are qualitatively consistent with the TDE hypothesis; though, the time baseline falls short of a definitive proof. Putting the single-object discovery into context, statistical analyses of the ~80 known N-rich quasars with high-quality archival spectra show evidence (at a 5σ significance level) of a decrease in N/C on timescales of >1 year (rest-frame) and a constant level of ionization (indicated by the C iii] λ1909/C iv λ1549 intensity ratio). If confirmed, our results demonstrate the method of identifying TDE candidates in quasars via abundance ratio variability, opening a new window of TDE observations at high redshift (z > 2) with upcoming large-scale time-domain spectroscopic surveys.