We study the effect of spatially dependent mass function over the solution of the Dirac equation with the Coulomb potential in the (3+1)-dimensions for any arbitrary spin-orbit κ state. In the framework of the spin and pseudospin symmetry concept, the analytic bound state energy eigenvalues and the corresponding upper and lower two-component spinors of the two Dirac particles are obtained by means of the Nikiforov-Uvarov method, in closed form. This physical choice of the mass function leads to an exact analytical solution for the pseudospin part of the Dirac equation. The special cases (l=l˜=0, i.e., s-wave), the constant mass and the non-relativistic limits are briefly investigated.