Anna Signeul, the Scots' coach, voiced her delight at the choice of venue.
Her team played their group games at Tynecastle but it is unavailable for the match on Saturday, October 20. Signeul said: "It's fantastic, what an opportunity for the players. It is the dream of every Scottish player, male or female, to play for their country at the National Stadium.
"It will be a great thrill for me and the staff as well, and I am delighted the Scottish Football Association have decided to host this game and showcase women's football. I also believe it gives us a better opportunity to qualify for the finals. We know we won't fill the ground but we hope the Tartan Army will turn out in large numbers.
"The finals next July are in Sweden. Nothing would make me more proud than to lead Scotland to a first major championship finals in my home country."
Spain are 17th in the rankings and the Scots 22nd. Russia play Austria and Iceland meet Ukraine in the other play-off matches. The return leg of the Scots' tie will be the following midweek.