In this article we analyze the Casimir-Polder interaction of atoms with a solid grating and an additional repulsive interaction between the atoms and the grating in the presence of an external laser source. The combined potential landscape above the solid body is probed locally by diffraction of Bose-Einstein condensates. Measured diffraction efficiencies reveal information about the shape of the Casimir-Polder interaction and allow us to discern between models based on a pairwise-summation (Hamaker) approach and Lifshitz theory.