Consider a Single "guess row":
It can have 5 Wrong entries - 1 Possibility
It can have 4 Wrong entries - (5/1) x 2 Possibilities (the remaining 1 is either Correct or Partially Correct)
It can have 3 wrong entries - (5x4/2x1) x 2x2 Possibilities (the remaining 2 are either Correct or Partially Correct)
It can have 2 wrong entries - (5x4x3/3x2x1) x ...
[EDITED to add:] No, this is wrong at present. For instance, my analysis assumes that you can have a row looking like GGGGY, which of course isn't possible because there's no other place for that last letter to go. That might possibly be the only way in which it goes wrong; I will think about that later, if someone else hasn't posted a more correct answer by ...
Daniel Mathias has solved this question in a comment on the MSE post, so for completeness I will summarize the entire strategy here.
X starts by claiming the center. Up to symmetry, O's response is one of the nine squares below:
Turns out that the optimal solution has been known since 1991. The answer is we need
gloves to have $n$ doctors operating on $n$ patients without the risk of infecting each other. This number is optimal.
Ilan Vardi published it in chapter 10 of Computational Recreations in Mathematica (Addison-Wesley). Both the proof ...
In the picture below, each column represents a solution that leads to a pair of fives, and each pair of fives can be resolved in 2 ways (depending on which 5 you move on the other 5).
In the first row, the red arrows show the first moves that merge the 1s into 2s, the blue arrows show the second moves to merge the 2s into 3s. In the second row, the red ...