It’s pay to pray at one Brooklyn synagogue.

Down-on-their luck panhandlers at the Chabad-Lubavitch world headquarters in Crown Heights have to follow the 11th Commandment: Fork over $5 for the right to beg inside.

“If you want to collect, you have to pay. If you don’t pay, you go on the street. It’s very simple,” said one outraged panhandler. “Poor people collecting money have to pay? It’s like extortion.”

The beggars either position themselves by the stairwell, in the lobby, or inside the prayer area of the monolithic, four-story brick temple, which stands alongside the original Lubavitch synagogue.

All said they are unemployed, live nearby, and sometimes attend services at the bustling temple, where hundreds come to pray from morning until night every day.

They say their right to panhandle in the house of worship comes from a higher authority — Jewish law, which allows begging in synagogues and public events, including weddings, where food is set aside for beggars and uninvited guests.

But instead of a helping hand, Rabbi Avrohom Holtzberg, a synagogue administrator known as a gabbai, looks for a handout, the panhandlers said.

“It’s like graft, payola,” charged a second beggar. “It’s embarrassing that you have to beg, and the fact they won’t help you is embarrassing — you’d think your rabbi would help you.”

“I can’t afford it — I only make about $40 a day,” the man added, saying he refuses to pay up, and instead stations himself outside the Eastern Parkway synagogue.

If they don’t comply inside, they’re shown the door and warned that if they don’t leave, the police will remove them, beggars said.

The policy has left the beggars with a sour taste in their mouths — and less cash in their frayed pockets.

“They feel like we use this place a lot, so they want a percentage,” said Steven, a third beggar, who would only give his first name.

Synagogue administrators did not respond to a Post inquiry, but some congregants denied that such a policy exists.

“It’s a lie from top to bottom!” said worshipper Mendel Drizin. “These rabbis are not poor people — they don’t need the $5 for people to beg inside.”

Beggars told the blog Failed Messiah that they were being slapped with a $5 fee because the congregation is “losing too much money” to the panhandlers. The policy has been in place for at least a year and a half, but only recently began to be enforced, beggars said.

“There are some of these guys who are legitimate, but a lot of them are disrupting the congregants,” a worshipper who wished to remain anonymous told The Post. “These [beggars] stay here for 12 hours. They don’t want them there.”