I didn't say there was an overlap in discourse--that's where the significant difference was. I said it was an overlap in function, which can also be described as "access to reason/logic."
I completely understand that there's a distinction to be made between an educated person who suffers from mental imbalance and an uneducated "primitive" with no mental health issues. My point is that both of these categories were historically defined, at least in part, by a specific description: a closeness to their animal natures. These were two different discourses that appealed to the same ostensible content (i.e. an apparent absence of reason). This made it easier for a chain of negative associations to emerge between insanity and racial otherness, even if they were separate discourses: in other words, the primitive quality of slaves made it easier to perceive them as mentally deranged. The discursive difference led to a difference in treatment. Asylums were racially segregated, and lots of "insane" blacks probably never made it into prison (I don't know the stats on this, but it's telling that Foucault's cases never feature black subjects--I'm almost positive the French asylum, Charenton, had no black patients). They would have been sent to detention centers for blacks, or simply "put down." In other words, blacks were more likely to be treated like animals, while whites were more likely to be treated as mad. The discursive differences were strong.
The overlap in content did lead to discursive overlap, as in the formation of the criminal type, which included both the insane and racial others.