Probably.
If he lived with you, for more than half the year, he is your "Qualifying child" (QC) dependent. The dates of legal guardianship are not as important as the time the time the child lived with you. So, for example, if the child lived with you from Jan. 1 to July 20, but only live with his new guardian July 21 to Dec 31; you get to claim him.
If there was some overlap (for example, the three of you lived together part of the time), then the relative the child lived with the most gets to claim him.