Osaka lost her opening 10 points on serve as Sorribes Tormo dominated in the opening set of the match at La Manga Club in Murcia.
The Japanese player led 2-0 in the second set, but Sorribes Tormo, ranked 78th in the world, fought back.
The winners will be one of 12 nations in April's new-look Fed Cup Finals.
"We knew Sara could make it very uncomfortable for Naomi and she stuck to the gameplan perfectly," said Spain captain Anabel Medina Garrigues.
Carla Suarez Navarro, playing in what is likely to be her last home Fed Cup tie, faces Japan's Misaki Doi in the second singles match later on Friday.
Great Britain are also trying to book their place in the Fed Cup Finals and they play away in Slovakia this weekend.