Brandon Deese lives just a few blocks from where he grew up, but it might as well be another world.

Mr. Deese, 23, spent his childhood at the Chelsea-Elliott Houses, a public-housing project in the West 20’s. But last year, thanks to a housing lottery, he beat out thousands of others for an affordable apartment at the Chelsea Park, a luxury rental at 260 West 26th Street.

“I used to go downstairs and see crack heads and drug dealers, and now when I go downstairs I see doormen,” said Mr. Deese, who himself works as a night doorman on the Upper West Side. He pays $540 a month for a studio, a discount of about 83 percent from the market-rate rent, which is around $3,200 a month, according to listings on StreetEasy.

Private developers have taken advantage of various programs to construct more than 100 mixed-income buildings like the Chelsea Park over the past two decades, mostly in Manhattan and gentrified parts of Brooklyn. In these buildings, the majority of apartments are market rate, with set-asides, typically 20 percent, for low- and moderate-income New Yorkers. In return for including these units, developers can receive lucrative tax abatements, permission to construct larger buildings and bond financing.

The competition for these units in these buildings, often called 80/20s, is fierce. Thousands of New Yorkers apply, but the stipulations are strict. There are income requirements and applicants must provide extensive documentation, such as pay stubs, telephone bills and bank statements. Good credit is also a necessity, typically a score of 650 or more. Making even one mistake, such as mailing an application express rather than by regular mail, can disqualify you from a lottery. Developers are generally required to give preference to those who live in the area.