We propose a scheme to measure a nuclear magnetic quadrupole moment (MQM), a CP-violating electromagnetic moment that appears in the nuclear sector, using the long-lived 3P2 metastable state in neutral 173Yb atoms. Laser-cooling and trapping techniques enable us to prepare ultracold 173Yb atoms in the 3P2 state trapped in an optical lattice or an optical tweezer array, providing an ideal experimental platform with long spin coherence time. In addition, our relativistic configuration interaction calculation for the 3P2 electronic wavefunction reveals a large magnetic field gradient generated by the atomic electrons in this state, which amplifies the measurable effect of an MQM. Our scheme could lead to an improvement of more than one order of magnitude in MQM sensitivity compared to the best previous measurement [S. A. Murthy et al., Phys. Rev. Lett. 63, 965 (1989)].