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.”
Asked by journalists about the post, a spokesman for the Scottish Government said he had not seen it.
Rowling has faced criticism after being vocal online about her views on transgender people and biological sex.
Earlier, a majority of MSPs on the 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.
A survey from the equalities, human rights and civil justice committee found out of 10,800 individual submissions, 59 per cent “disagreed with the overall purpose of the Bill”.
Opponents have argued the Bill “contradicts aspects of the Equality Act” and erodes “safety, privacy, dignity and opportunities for women”.
Campaign group For Women Scotland hosted a rally outside Holyrood following the recommendation, with speakers including former Scottish Labour leader Johann Lamont and Maya Forstater of Sex Matters.
Ms Lamont told demonstrators that upon its establishment, the Scottish Parliament “was a Parliament where policy, where action, where law was shaped by an understanding of what created division and inequality”.
She said: “The particular role was for the committees, which would breach the wall of the Parliament and allow the people of Scotland to participate in what the world could be.
“That has not happened.
“It is not their job to decide before the committee meets who they will listen to, who they will speak to, and only listen to those who already agree with them.
“I’m not saying that the committee should agree with everything that we say. But they should listen, they should challenge, they should argue, they should probe.
“They should not dismiss, because in that world of dismissal, you shoot the messenger. You ignore the message, you make bad law and other people live with the consequences.
“So my challenge is to my friends and all of the people in there who have the honour of being elected members. Your job as lawmakers is not just to put into law what you think is right, but understand the laws of unintended consequences.”
Ms Lamont said she was “conscious” of the importance of women’s rights.
She told the crowd: “I was told 40 years ago, by young men ‘now is not the time. There are other campaigns that matter. There are other people that are more vulnerable’.
“I said then ‘if you don’t address women’s inequality, we will never have true equality’. And that is as true now as it was then.”