Disclosed are methods and compositions for treating ore preventing a STAT5-mediated medical condition, e.g., rheumatoid arthritis, in a subject by administering to the subject a therapeutically effective amount of a compound, the compound being a STAT5 inhibitor, or a pharmaceutically acceptable salt of the STAT5 inhibitor, or a solvate of the STAT5 inhibitor, or a prodrug of the STAT5 inhibitor. In one example, the compound used in the methods and compositions is pimozide. In another example, the compound used in the methods and compositions is nicotinohydrazide.