The yield of charged particles opposite to a Z boson with large transverse momentum (p_{T}) is measured in 260 pb^{-1} of pp and 1.7 nb^{-1} of Pb+Pb collision data at 5.02 TeV per nucleon pair recorded with the ATLAS detector at the Large Hadron Collider. The Z boson tag is used to select hard-scattered partons with specific kinematics, and to observe how their showers are modified as they propagate through the quark-gluon plasma created in Pb+Pb collisions. Compared with pp collisions, charged-particle yields in Pb+Pb collisions show significant modifications as a function of charged-particle p_{T} in a way that depends on event centrality and Z boson p_{T}. The data are compared with a variety of theoretical calculations and provide new information about the medium-induced energy loss of partons in a p_{T} regime difficult to measure through other channels.