A Brooklyn lawmaker is renting a government-owned beach to host two gender-segregated swim days this summer for his Jewish and Muslim constituents.

But since the beach would normally be closed those two days, City Councilman Chaim Deutsch says he’s hopeful of avoiding a fight over the separation of church and state at tax-funded facilities.

“I have a lot of Orthodox Jewish and Muslim constituents in my district who have never been able to go to the beach before,” the Brooklyn Democrat told The Post on Wednesday.

“They’ve never been able to smell the beach, to walk in the sand. Everyone should be able to enjoy the beach.”

Deutsch said he is raising private funds to cover the cost of taking over the beach for two days at Kingsborough Community College, which sits next to popular Manhattan Beach in south Brooklyn.

Under his plan, June 29 would be set aside for men and boys from 9 a.m. to 3 p.m., while July 27 would be reserved for women and girls during those hours.

The beach would normally be closed on both Fridays, since the college doesn’t have summer classes that day.

Deutsch said men and women of all faiths would be welcome on their respective days.

He said he did not ask the city’s Human Rights Commission for guidance, but doesn’t expect any issues, and couldn’t say how a transgender individual would be treated.

When told of Deutsch’s plan, commission spokesman Seth Hoy said in a statement, “The NYC Commission on Human Rights does not speculate on potential violations of the NYC Human Rights Law.”

But the New York Civil Liberties Union blasted the separate swims as discriminatory.

“What chutzpah. People don’t have the right to impose gender discrimination on a city beach simply because it’s mandated by their religion,” said Donna Lieberman, NYCLU executive director.

“It is one thing for the city to provide reasonable accommodation for religious practice, and quite another to limit the public access of everybody else.”

Deutsch is paying $400 per day to cover the cost of lifeguards and other staff, a college spokesman said. “We want to be neighborly. This was a request made by the councilman . . . he’s been very supportive to us,” said Anthony Andrews. He said he was “unaware” if the college had ever rented its beach for a public or private event before.