I think the usual way to measure component Q with an S21 measurement is to place the cap in series with an inductor and then put this in shunt as an acceptor circuit to ground. Then measure the notch depth at resonance. If it was first done with a cap of known lower Q and then re-measured with the high Q test capacitor then it would be possible to work out the Q of the high Q cap by comparing the notch depths and doing a few calculations. This method does rely on having accurate test port impedances (usually 50R) or errors can creep in.
The other way to do it with S21 would be to arrange the network as a parallel resonant circuit and measure the change in 3dB bandwidth when the known medium Q resonator cap is swapped for the high Q test cap. There are probably other methods but I use these two methods here quite often when measuring (very) high Q inductors. Care is needed with this method as it is easy to introduce unwanted loading (or subtle Q multiplying) of the resonator.