I find two words dama.
The first word was, at the latest in the 13th c., borrowed from French, its meaning is woman of rank.
The second word is a borrowing from French too, time unknown. Its meaning is promotion row. The Spanish lexicography does not mention the word. I found it in the chess book written by Luis Ramirez de Lucena, “Repetición de amòres e arte de axedres” (1497): (…) que entra dama y el primer lance que della iugare que prenda y de xaque como dama ((…) that enters the promotion row and gives check at its first move as a queen).
This word has been invented by French draughts players, the French form was dam(e), meaning row of the draughts board where the singleton is promoted to doubleton.
French chess players borrowed the new word from draughts players, adding the new sense of row of the chess board where the pawn is promoted. This word dam(e) was useful to talk a game over! And with this sense they passed the word to Spanish chess players. It is also a proof that Spanish borrowed the words related to the word dama, as the Spanish game name juego de damas, from French.
The word dama meaning chess queen is a new sense of one of these two words. From which one? I explain why I chose the second word.
The English language has the homonym bank. One word bank is connected with financial matters, the meaning of the other word bank is elevation, for instance a piece of furniture in our living room. A silly question: when the English Department of Waterways and Public works ‒or whatever its name might be today‒ warns the shipping traffic for a bank before the mouth of the Thames, to which word bank then refers the service? The second word bank of course, as it regards an elevation of the seabed.
I ask my silly question once more: is the word dama connected with the word dama in the sense of woman of rank or in the sense of promotion row? With the second word dama of course. To be precise: the word dama in the sense of row of the chess board where the pawn is promoted to fers, because the chess queen is a pawn that is promoted when it reaches the promotion row. From a linguistic point of view this is the only reasonable etymology.
The Roman chess queen: etymology
I find two words dama.