An Upper West Side mom suffering from a debilitating genetic disease is getting a new lease on life — thanks to a kidney from a complete stranger.

Ewa Moskovitch, 40, was diagnosed with polycystic kidney disease at 20, and the inherited condition, in which cysts grow on the kidneys and can cause the organ to fail, only worsened when she had her daughter, Sophia, now 3.

“We realized the key function of my kidneys were getting worse and worse,” Moskovitch, who was put on the transplant list two years ago, told The Post.

Enter writer Elissa Wald, a former city resident who now lives in Portland, Ore., with her husband and two children.

Around the same time Moskovitch landed on the transplant list, Wald heard a rabbi give a speech that inspired her to offer her kidney to someone in need.

“My dream was always to give a kidney to a young mother with a young child,” Wald, 50, told The Post.

She explained that she sometimes “lived in fear” of leaving her own 13-year-old daughter and 11-year-old son too early and wanted to help a young mom.

“My idea was to take someone out of that situation,” she said.

Wald said she “went down the road” of trying to help at least five potential organ recipients, going through tests and paperwork, but in each case, they either weren’t a match or ended up finding a kidney elsewhere.

“I felt happy that they were getting a kidney, [but] I wondered if it would ever work out [for me to help],” Wald said.

Then Wald found Brooklyn-based kidney matchmaker Chaya Lipschutz, who donated her own kidney to a stranger in 2005 and since then has worked to connect donors and recipients all over the country.

“She worked with me to find my dream recipient,” Wald said.

Eventually, Lipschutz got a Facebook message about Moskovitch and thought she might be the right match for Wald.

Five months ago, Wald traveled to New York — where she’d lived for nearly 20 years before moving to Portland — to undergo tests at Weill Cornell Medicine.

When she learned she was enough of a match that the transplant could work, “I was ecstatic,” Wald said.

Wald, who turned 50 on Sept. 23, joked that when people asked what she was doing for her birthday, she’d respond, “I’m hoping to donate a kidney.”

She and Moskovitch underwent a successful transplant operation Thursday — meeting for the first time right before their surgeries.

Moskovitch said she will be forever grateful.

“I feel extremely blessed to be able to go through this,” she said. “She’s just the most amazing person in the whole world.”

Additional reporting by Susan Edelman