When Duane Reade opened a new store a few months ago in Brooklyn, it faced opposition from residents loyal to a local pharmacy. So it decided to include something in the store that the neighborhood did not have: a bar that specializes in beer.

One corner of the Duane Reade store on Bedford Avenue in the Williamsburg neighborhood has Fire Island Lighthouse Ale and eight other beers on tap, with growlers — refillable glass bottles — lining the walls. Uniformed clerks-cum-beer-experts fill the growlers and conduct tastings only — sorry, no pints served. Behind a bar, a large walk-in refrigerator stocks common national brands as well as local, craft and imported beers. “We knew we would have a little bit of a battle to try to bring Duane Reade into this community, because they really don’t like a chain store,” said Paul Tiberio, senior vice president for merchandising and marketing at the company.

The Williamsburg beer bar is part of a larger effort by Duane Reade to recognize — and capitalize — on the fierce identity and local needs of many New York City neighborhoods.

In some residential areas of Midtown East in Manhattan, for example, the stores sell cut flowers and, over the holidays, they sold fresh-baked pies. In the Bronx, Duane Reade carries more items from Goya, a brand of Hispanic foods, than it does in other areas, and has 40-foot-wide sections of African-American hair products in Harlem and the Bronx.