  In the QCD energy-momentum tensor $T^{\mu\nu}$, the terms that contribute to
physical matrix elements are expressed as the sum of the gauge-invariant quark
part and gluon part. Each part undergoes the renormalization due to the
interactions among quarks and gluons, although the total tensor $T^{\mu\nu}$ is
not renormalized thanks to conservation of energy and momentum. We show that,
through the renormalization, each of the quark and gluon parts of $T^{\mu\nu}$
receives a definite amount of anomalous trace contribution, such that their sum
reproduces the well-known QCD trace anomaly. We provide a procedure to derive
such anomalous trace contribution for each quark/gluon part to all orders in
perturbation theory, and obtain the corresponding explicit formulas up to
three-loop order in the $\overline{\rm MS}$ scheme in the dimensional
regularization. We apply our three-loop formulas of the quark/gluon
decomposition of the trace anomaly to calculate the anomaly-induced mass
structure of nucleons as well as pions. Another application of our three-loop
formulas is a quantitative analysis for the constraints on the twist-four
gravitational form factors of the nucleon, $\bar{C}_{q,g}$.
