Imagine a card game. Playing it involves comparing the relative strengths of different card. Whichever card you play, you opponents have to accept it as more or less strong than the cards they have played. You can change the course of the game by playing a certain sort of card.
Whe you 'play the race card' you try to get an advantage (usually in an argument) by referring to race - 'You're only saying that because I'm Jewish/black/caucasian...'/'You wouldn't say that if I wasn't <some-race>' . And it can be used positively as well: 'Can't you make an exception for a poor little <race-marker>.
You will see the idiom 'play the ... card' in several other contexts - 'play the gay card' ...
PS Your version - 'pull out the race card' - is perfectly valid. Going back to the card game, you have all your cards fanned out in one hand. With the other, you pull out the one you want to play. In the context of this expression, 'pull out' has slightly more of an 'Aha, see what you can do with this!' attitude to the card played.