The precise measurement of transition frequencies of trapped atomic samples is susceptible to inaccuracy arising from the inhomogeneous differential shift of the relevant energy levels in the presence of the trapping fields. We demonstrate near-complete cancellation of the differential ac Stark shift ("light shift ) of a two-photon magnetic-field-insensitive microwave hyperfine (clock) transition in Rb-87 atoms trapped in an optical lattice. Up to 95(2)% of the differential light shift is cancelled while maintaining magnetic-field insensitivity. This technique should have applications in quantum information and frequency metrology.