  In this article, we propose a novel approach to measure the branching ratios
of the leptonic eta(')-> mu+mu- decays by using charmed meson decays, namely,
D+(s)->pi+ eta(')(->mu+mu-) and D0->K-pi+eta(')(->mu+mu-). We advocate that the
data available at LHCb can already yield a new measurement of Br(eta->mu+mu-)
with accuracy competitive with the current world average. We also estimate that
using the data collected by LHCb between 2015 and 2018 in proton-proton
collisions at a centre-of-mass energy of 13 TeV, corresponding to an integrated
luminosity of 5.0/fb, the relative uncertainties to this branching ratio can be
reduced down to ~10%. We also show that the first observation of
Br(eta'->mu+mu-) may be possible with the Upgrade of the LHCb experiment.
