In a part of Williamsburg, Brooklyn, that has been transformed in recent years by modern apartment buildings and fast-casual restaurants, a nondescript door on Grand Street is the entrance to Toñita’s, one of the last Puerto Rican outposts of its kind in New York City. Here, the customers drink $3 beers and play dominoes, or sit around and chat over free plates of food like arroz con gandules.

The walls are crowded with Puerto Rican flags and portraits of the bar’s owner and matriarchal figure, Maria Antonia Cay, who is more commonly known as Toñita. She opened the place in the 1970s as the Caribbean Social Club, a members-only hangout for the neighborhood baseball team. In 2000, she obtained a liquor license and opened the spot to everyone for cheap drinks and pots of Puerto Rican dishes that she makes in her apartment kitchen upstairs. (She bought the building decades ago.)

“It reminds me of home,” said Djali Brown-Cepeda, an archivist and filmmaker who runs the Nuevayorkinos Instagram account.

As neighborhoods like Williamsburg gentrify and businesses owned and frequented by people of color close, many of the people who grew up there fear they’ll lose the community outposts where they can speak Spanish, dance and play games. Ms. Cay said she has been offered millions of dollars for the building but will not sell.

A few dozen regulars held a rally outside the Municipal Building in Manhattan last month after a visit by a city inspector fed those worries. Ms. Cay said the inspector asked for minor repairs that she has since completed. The city has also received at least 10 noise complaints about the club in the past year. The bar has an A rating from the city health department, which last inspected it in April.

“I wasn’t worried” about being shut down, Ms. Cay, 83, said in Spanish. “I’m staying here with my people as long as I can. This isn’t for me to make money or a fortune. It’s to maintain a space for all of us to be together.”

The club, which for decades was something of a local secret, has recently drawn attention from celebrities like Maluma and Madonna, who did a joint photo shoot there for Rolling Stone in 2021. The reggaetonero Bad Bunny has also visited, and given Ms. Cay a hug.

Most nights, Ms. Cay runs the show from a bar stool in the back. Her nails are always immaculate and her blond hair is perfectly set, even as the two rooms grow warmer as the night goes on. She says retirement is not on her horizon, and she doesn’t know who might take over for her when she’s gone.

Her customers defend Ms. Cay as if she were their own abuela, or grandmother, Ms. Brown-Cepeda said.

“We have to protect this woman, we have to protect this site. It’s sacred,” she said, adding that people of color were “very tired” of seeing the arrival of developers and the departure of older local businesses, like Chino Latino restaurants.

Social clubs like these have long been popular in Cuba and Puerto Rico, and first began to open throughout New York City in the 1920s as immigrants came, said Nancy Raquel Mirabal, a professor at the University of Maryland, College Park and the author of “Suspect Freedoms,” a 2017 book about Cuban immigration and politics in New York.

At first, these clubs were places for people to gather to speak Spanish, eat their own food and discuss politics. Later, they provided a hub for networking, learning English and gaining new job skills; some even provided access to health insurance. In the last half-century, the clubs have attracted people from many different Latino cultures.

In her best-selling 2022 novel “Olga Dies Dreaming,” the author Xochitl Gonzalez devotes a chapter to Toñita’s, which she calls Sylvia’s Social Club. It is run by a glamorous Puerto Rican woman who treats her customers as if they were guests in her home. Ms. Gonzalez, who was raised in Sunset Park, Brooklyn, frequented Frank’s Cocktail Lounge, a Black-owned business in Fort Greene, Brooklyn, which closed in 2020, as well as Toñita’s, when she was a young adult.

“It’s more than just a bar,” said Ms. Gonzalez, who is a staff writer for The Atlantic. “It’s a place where so many aspects of culture get preserved. Sometimes, the Puerto Rican influence in this city has been rendered so invisible that they’re going to miss us when we’re gone.”