We study the radial gradient of the solar rotation rate in the near-surface shear layer (NSSL) from about .950 R⊙ to the solar surface and its variation during Solar Cycles 23 and 24 with ring-diagram analysis applied to Global Oscillation Network Group (GONG) and Helioseismic and Magnetic Imager (HMI) Dopplergrams. The average radial gradient is ∂ log Ω/∂ log r = − 1.0 ± .1 at .990 R⊙ in agreement with previous studies. The average radial gradient is ∂ log Ω/∂ log r = − .11 ± .01 at the base of the NSSL at .950R⊙, while it is steeper than −1 closer to the surface between .990R⊙ and .997R⊙. The average radial gradient is rather flat within ±40° latitude from about .970 R⊙ to the solar surface. The radial gradient of the solar rotation rate varies with the solar cycle. At locations of high magnetic activity, the radial gradient is more negative than average from about .970 R⊙ to .990 R⊙, while in quiet regions the radial gradient is less negative than average at these depths. Close to the surface at .997 R⊙, this relationship appears to be reversed. Prominent features of the solar-cycle variation of large-scale flows, such as poleward branches or precursor flows, are not obviously present. The variation of the radial gradient thus more likely indicates the presence or absence of magnetic flux above a certain threshold. The temporal variations derived from the different HMI and GONG data sets agree within one error bar at most depths and latitudes, while their amplitudes might be different.