We investigate the effect of stress fluctuations on the stochastic dynamics of an inclusion embedded in a viscous gel. We show that, in nonequilibrium systems, stress fluctuations give rise to an effective attraction towards the boundaries of the confining domain, which is reminiscent of an active Casimir effect. We apply this generic result to the dynamics of deformations of the cell nucleus, and we demonstrate the appearance of a fluctuation maximum at a critical level of activity, in agreement with recent experiments [E. Makhija, D. S. Jokhun, and G. V. Shivashankar, Proc. Natl. Acad. Sci. U.S.A. 113, E32 (2016)PNASA60027-842410.1073/pnas.1513189113].