In most countries, it is legally protected for employees to discuss their pay with colleagues if they choose to — employers cannot prohibit this by contract. However, approaching colleagues directly about their specific salary requires trust and judgment about your relationships.
A more reliable and less sensitive approach is to use market data: the Expertini Salary Benchmark draws from real job postings and salary surveys to give you the market range for your role and location, which is more relevant to your negotiation than a single colleague's figure anyway.
If you suspect genuine pay discrimination based on a protected characteristic (gender, ethnicity, disability), this is a separate legal matter — consult your national employment rights guidance or an employment solicitor.