By the 1980s, most astronomers believed that either gravity was wrong or that dark matter existed. This led to a re-evaluation of Zwicky's work of the 1930s. Soon after that, many other clusters were studied and the same results found - a need for dark matter. The temperature of gas depends on the mass of the cluster. The more mass, the hotter the gas is.
Simple calculations can relate the mass to the temperature.
As the x-ray telescopes became better, we were able to measure accurately the mass. Here is another example of lensing. We know that the amount of bending is due to the amount of mass present. Thus, we can measure the cluster mass by using the strength of the lens. For galaxy clusters, we have three independent ways to measure mass, and they all give about the same result.