We combined sensitive near-infrared data obtained with ground-based imagers on the ESO NTT and VLT telescopes with space mid-infrared data acquired with the IRAC imager on the Spitzer Space Telescope to calculate the extinction law A_lambda/A_K as a function of lambda between 1.25 and 7.76 micron to an unprecedented depth in Barnard 59, a star forming, dense core located in the Pipe Nebula. The ratios A_lambda/A_K were calculated from the slopes of the distributions of sources in color-color diagrams lambda-K vs. H-K. The distributions in the color-color diagrams are fit well with single slopes to extinction levels of A_K ~ 7 (A_V ~ 59 mag). Consequently, there appears to be no significant variation of the extinction law with depth through the B59 line of sight. However, when slopes are translated into the relative extinction coefficients A_lambda/A_K, we find an extinction law which departs from the simple extrapolation of the near-infrared power law extinction curve, and agrees more closely with a dust extinction model for a cloud with a total to selective absorption R_V=5.5 and a grain size distribution favoring larger grains than those in the diffuse ISM. Thus, the difference we observe could be possibly due to the effect of grain growth in denser regions. Finally, the slopes in our diagrams are somewhat less steep than those from the study of Indebetouw et al. (2005) for clouds with lower column densities, and this indicates that the extinction law between 3 and 8 micron might vary slightly as a function of environment.