IR radiation goes further into a material than does light in the visual spectrum, so it tests a little deeper than just the surface. How deep into a material the radiation penetrates depends on the material however, so I think it may be hard to give a simple answer. A black bag probably won’t work (stuff that is black in the visual spectrum tend to also absorb IR radiation well) and an orange peel is probably too thick if you are hoping to say anything about e.g. the pulp (however, the peel of an orange may have markers that correlate well to qualities of the pulp, so this is not as futile as trying to determine properties of something inside a black bag).

A little primer on NIRS: https://en.wikipedia.org/wiki/Near-infrared_spectroscopy