We study the pressure anisotropy in anisotropic finite-size systems in SU(3) Yang-Mills theory at nonzero temperature. Lattice simulations are performed on lattices with anisotropic spatial volumes with periodic boundary conditions. The energy-momentum tensor defined through the gradient flow is used for the analysis of the stress tensor on the lattice. We find that a clear finite-size effect in the pressure anisotropy is observed only at a significantly shorter spatial extent compared with the free scalar theory, even when accounting for a rather large mass in the latter.