We present an all-optical method to load 174Yb atoms into a single layer of an optical trap near the surface of a solid immersion lens which improves the numerical aperture of a microscope system. Atoms are transported to a region 20 um below the surface using a system comprised by three optical dipole traps. The optical accordion technique is used to create a condensate and compress the atoms to a width of 120 nm and a distance of 1.8 um away from the surface. Moreover, we are able to verify that after compression the condensate behaves as a two-dimensional quantum gas.