The evolution of the energy difference between the neutron states 1i 13/2 and 1h 9/2 in the N = 82 isotones and that between the proton states 1h 11/2 and 1g 7/2 in the Z = 50 isotopes are investigated within the framework of the relativistic Hartree-Fock theory, using the density-dependent effective interactions PKA1 and PKOi (i = 1, 2, 3). By identifying the contributions of the tensor force, which is naturally induced via the Fock terms, we find that the tensor force plays crucial roles in the evolution of the shell structure. The strength of the tensor force is also explored. It is found that moderately increasing the coupling strength of pion-nucleon coupling, i.e., fπ, will significantly improve the description of the shell-structure evolution. In particular, reducing the density dependence of fπ is shown to be more preferable, in comparison to enlarging fπ with a factor. This is in consistence with the idea of "tensor renormalization persistency" and provides valuable guidance for the development of nuclear energy density functional in the relativistic framework.