That last comment is the most striking one:
I am unsure on how to approach this without making them feel like I am accusing them of being a sexist or racist (I am a person of colour).
If you don't know how to approach a problem of compensation without immediately jumping to the conclusion that your boss/company is bigoted towards you, you're going to have a very bad time, as you're going to ruffle a lot of very big feathers very consistently and find yourself on the wrong side of a lot of problems.
Allow me to give you a lesson: The way to not accuse someone of being a bigot is simply: don't accuse them of being a bigot. Are you able to have a conversation regarding your compensation without raising the issue of your race or gender? Is there any other reason, literally anything, that you can think of that may impact your compensation? Here are a few general examples that may or may not apply:
You're not good at negotiation. The other person asked for a higher salary than you and got it. You should have asked for a better salary, but you didn't.
The other person has a better resume than you; you have 3 years work experience, maybe he has 6, or maybe his career pedigree is better than yours (he's worked at "better" companies), or maybe his education is better than yours.
The other person has some kind of specialized expertise that you don't have that the company found attractive.
He was poached from a company and had to be offered an attractive package that you weren't offered.
There are a lot of possible reasons why someone may have better compensation than you, and it's up to you to see that and not immediately and reflexively reduce every problem to bigotry. This is something you aggressively need to work on, because, as you said, you're not going to be able to negotiate for anything if you immediately pull the race/gender card at every problem that comes your way; that works on Twitter but not in real life.
But that's not the question you asked; the question you asked is how to approach this problem when speaking to your boss. Which I've said a lot about what not to do, but nothing about what to do. Here's what you should do:
Do some research and find out what you're worth. If you believe you're due a raise, then say so, and be prepared to explain why. If you say "I want a raise" and your boss says "what have you achieved" and you have no good answer, you're not going to get that raise. So tally up some things that you've achieved and some value you've provided, and say that, based on those accomplishments, you believe you deserve a raise. Your boss may or may not ask you how much of a raise you want, at which point you can tell them. However, in this case, don't say something stupid. Even if you believe you're due a raise of 30% to match your coworker (as an extreme example) and you believe the company can afford it, no company is going to give you a 30% raise after 9 months, it's just not going to happen, no matter what. So, be reasonable and ask for something that you think you can actually get. Since inflation is really high (at least in North America), you may be able to get away with a higher number than you would normally be able to, but even then, don't say something ridiculous. Your boss may try to negotiate you down, so be prepared for that and negotiate in good faith, as much as you can.
But the most important part of this is to be able to explain to your boss why, based on your accomplishments, and not your skin color or your gender, you deserve a raise. Surely, in 9 months, there are copious things you can point to to encourage your employer to pay you more, and you don't need to lean on bigotry as a crutch. Use those things, let those things stand on their own. And if they're not good enough, then maybe you simply don't deserve the raise you think you deserve. Or maybe your company is actually bigoted (it does happen, but not nearly enough to jump to such a conclusion without exploring other angles) and you need to find another job.