Yes! In fact, this kind of phenomenon is very common. For example, the mass of a proton is much greater than the sum of the masses of the constituent quarks. Much of the extra mass comes from the gluons that bind the quarks together; like photons, gluons areeach gluon is massless, but collectively they contribute to the inertia.
The point is that the mass of a system is not the same as the sum of the masses of its constituents. Of course, this is just a rephrasing of $E = mc^2$. If you have photons bouncing back and forth in a box, their energy contributes to the total mass.