In the summer of 2012, Windsor Terrace residents packed into a community meeting, furious that the Brooklyn neighborhood’s sole supermarket, Key Food, was being replaced by a giant Walgreens drugstore. Jack O’Connell, who had lived there since 1985, was put off by the rancor. But in the middle of all of the arguing, one man raised his hand with a suggestion:

“Maybe we should start a food co-op.”

It was the first positive idea Mr. O’Connell had heard all night, and after the meeting ended, he raced after the man on the sidewalk to see just how serious he was.

Until recent years, Windsor Terrace was not the kind of neighborhood that would have needed or wanted a food co-op. It was filled with old Brooklyn families, mostly Irish, Polish and Italian. If someone didn’t go to Key Food, they went to the local greengrocer on Prospect Park West. “All the old-timers knew him,” Mr. O’Connell said of the shopkeeper. Additionally, the neighborhood had social anchors like the American Legion and VFW halls where people congregated.

But as Park Slope became increasingly unaffordable, Windsor Terrace — just to the southwest — began attracting younger families, who found Key Food a dreary shopping experience. And by this time, the old-time gathering spots had closed.

“Now a whole new group of younger people have moved in and are wondering where you go to interact with your community,” Mr. O’Connell said. “There’s a lot of desire for this.”