Local shear viscosity of strongly inhomogeneous dense fluids: from the hard-sphere to the Lennard-Jones fluids