In the post, the Good For You singer said fans had been wondering why she had been "laying low" over the summer.
"I found out I needed to get a kidney transplant due to my lupus and was recovering. It was what I needed to do for my overall health," she said.
The singer also shared images of a post-operative scar on her lower abdomen.
Gomez, who with 126 million Instagram followers is the most-followed person on the social media platform, also revealed the donor was her longtime friend Francia Raisa, an actress best-known for her role in TV series The Secret Life of the American Teenager.
"There aren't words to describe how I can possibly thank my beautiful friend," she said of Rasia.
"She gave me the ultimate gift and sacrifice by donating her kidney to me. I am incredibly blessed. I love you so much sis."
At the time of writing, Gomez's post had massed close to 6 million likes on Instagram.
Gomez's representatives were not immediately available for comment.
Only 3 per cent of kidney transplants are for lupus
Gomez revealed her lupus diagnosis in 2015 and took a break from her career last year to deal with anxiety, panic attacks and depression stemming from her battle with the disease.
Lupus is an autoimmune disease, where the body mistakenly attacks its own tissues, sometimes including the kidneys.
One healthy kidney is all the body needs, so a single kidney transplant can resolve the problem, said Dr David Klassen, chief medical officer for the United Network for Organ Sharing, which runs the United States' national transplant system.
"Lupus tends to be a disease of younger women, and younger people tend to do better with transplants than older patients, so the expectation is she would do quite well," he said of Gomez.
Lupus also tends not to come back after the operation.
"The drugs that prevent kidney rejection are also very good for treating lupus, the underlying disease," Dr Klassen said.
The causes of lupus are unknown. Symptoms can include bloody or foamy urine, unexplained weight gain, high blood pressure or swelling in the legs, ankles or around the eyes.
Only about 3 per cent of kidney transplants are for lupus — most are due to diabetes or chronic damage from high blood pressure.
There were about 19,000 kidney transplants in the US last year.
Gomez has topped the US charts on multiple occasions since the release of her first album in 2013, and was regularly the focus of the celebrity press for her relationship with Canadian singer Justin Bieber.
Gomez, whose hits include Good for You, Same Old Love and Come & Get It, has been in the spotlight since she was a child. She appeared on Barney and Friends before breaking through as a teen star on the Disney Channel's Wizards of Waverly Place.
Gomez, who has been dating the singer The Weeknd for several months, also has had success behind the scenes as the executive producer of Netflix's 13 Reasons Why, the controversial young adult series.