New Yorkers now have the chance to enter an affordable housing lottery — open to both low- and middle-income residents — that will give them the shot at scoring a home at a building overseeing the Barclays Center. 

Starting on Thursday, the first affordable housing lottery at Pacific Park Brooklyn — a redevelopment of 22 acres in downtown Brooklyn that includes the sports and entertainment arena, and housing and retail space — opened on the city’s lottery portal, NYC Housing Connect

The housing lottery, which will be open through June 27, is for 181 below market rate apartments at the 32-story tower located at 461 Dean St. and will be set aside for households earning between 30 to 160 percent of the area median income. 

RELATED:    New Yorkers will spend over half of their income on rent this year: Report

Out of the 181 affordable housing units, over 70 of them will be made available to individuals and households that make more than 100 percent of the area’s median income — meaning those earning up to $144,960 per year are eligible to apply. 

More cities across the country  — including Cambridge, Massachussets and San Francisco — are requiring developers to set aside rental units in developments for middle-income families as rents continue to sky rocket beyond increases in wages, The Wall Street Journal reported. 

Developers have accepted the middle-class housing requirements because, according to The Wall Street Journal, it allows them to build taller projects. 

The remaining units at 461 Dean St. will be designated for applicants that are making as low as $20,675 per year. 

The affordable units are divided into 75 studios, 70 one-bedroom apartments and 36 two-bedroom apartments. 

Those looking to qualify for affordable housing at the Brooklyn site must enter the lottery run by the city’s Housing Development Corporation through filling out an application online. Applicants are allowed to submit one application per household. 

Preference to the lottery will be given to residents currently living in Brooklyn’s Community Boards 2, 3, 6 and 8; others who might get preference include city workers, and those with disabilities. 

RELATED: NYC millennials earn less than generation before, work in low-wage industries: Report

The Dean Street residential building, which was developed by Forest City Ratner Companies and designed by SHoP Architects, is the first to open at the Brooklyn site and in total is made up of 363 rental apartments with 4,000 square feet of ground floor retail. 

The site — expected to begin occupancy in the fall — has amenities including a 24-hour doorman, a fitness center, lounge/game room, yoga/dance studio, children’s playroom, and a roof terrace. Every unit in the building also comes with a washer and dryer. 

Pacific Park Brooklyn currently has over 1,800 units of housing under construction in six buildings — with 782 designated for below-market rates. Once construction is complete, the site will have a total of 6,430 housing units.