The author tweeted a picture of herself wearing the garment on Thursday as she gave her backing to a protest outside the Scottish Parliament over controversial gender recognition legislation.
The T-shirt read: “Nicola Sturgeon: Destroyer of women’s rights.”
Ms Rowling tweeted: “I stand in solidarity with @ForWomenScot and all women protesting and speaking outside the Scottish Parliament. #NoToSelfID.”
It came as a majority of MSPs on Holyrood's equalities, human rights and civil justice committee recommended the general principles of the Gender Recognition Reform (Scotland) Bill should be approved.
The legislation aims to make it easier for transgender people to be legally recognised as their preferred gender.
Supporters say the move will streamline a process many find distressing, but critics have raised concerns self-identification will undermine women’s sex-based rights, such as access to women-only spaces.
Asked about Ms Rowling’s tweet, Ms Sturgeon told BBC Radio’s Good Morning Scotland programme: “People are entitled to express their views, and they’re entitled to express their views in whatever way they think is fit.
"I’ve always thought, on this issue, where people have very strong views, we should all try to treat each other with respect, and that’s what I will continue to do.”
Ms Sturgeon said the gender recognition process was “degrading and traumatic”.
She said: “This Bill is about reforming an existing process that is degrading and traumatic for trans people, seeking to make it less traumatic for those who want to legally change their gender.
“It doesn’t give any additional rights to trans people, nor does it take any rights away from women.”
The First Minister added: “It’s men who attack women and we need to focus on that, not on further stigmatising and discriminating against a tiny group in our society who are already one of the most stigmatised.”
Ms Sturgeon said she was a “passionate, life-long feminist”.
She said: “Any man who seeks to abuse the law on gender recognition for nefarious purposes would be committing a criminal offence under the proposed Bill that’s before the Scottish Parliament.
"It’s right to make a degrading and traumatic process simpler for trans people.”