In the blocks surrounding 14th and U streets NW, restaurants are packed with diners and shoppers clog the sidewalks. Overhead, construction cranes stretch across the horizon as the neighborhood — not so long ago pocked by vice and blight — rises higher into the sky.

Over the years, dozens of black churches in the District have moved to the suburbs, following many of their parishioners. But John Wesley AME Zion, among others whose neighborhoods have gentrified in recent years, is determined to stay put.

“I grew up in this church. I left, but I always come back,” said Mariea Alexander, 45, of Springdale in Prince George’s County. As her niece Jailah, 10, and 3-year-old granddaughter Chloe trailed behind her, Alexander added that she wanted to work with teens to keep them “on the straight path.”

“I feel inspired,” she said. “I feel like I’m needed here.”

When Wesley moved into a former Episcopal church at 14th and Corcoran about 100 years ago, it had more than 1,000 parishioners, many of them “principals, schoolteachers . . . barbers and business owners,” said member Clennie Murphy, 75.

Today, it has about 300, in a sanctuary that seats 1,600. And more than half of the congregants are 60 or older, including Clementine Brown, the church’s 96-year-old historian.

How does a church remain relevant in a neighborhood that has changed dramatically, and where most of its congregants no longer live?

Wesley is going long, recently celebrating the completion of a $2.5 million renovation. The money came from a partnership with a developer that transformed the parking lot of the church in the Logan Circle area into a five-story condominium building. Its spiffiest units go for more than $1 million.

The goal: To create a blueprint for the neighborhood, and to pull the community into the stately red-brick sanctuary, which features a new banquet hall, meeting rooms, freshly cushioned pews and a grand wooden ceiling that had been hidden for decades.

Beyond renting its facilities for weddings and other events, the church hopes to open an elder-care center, said Pastor Vernon A. Shannon. “We didn’t have the space to do this before,” he said.

The church also is considering creating a “Saturday academy,” where the predominantly black congregation’s retired teachers could help keep teens stay in school. Another possibility is a bimonthly jazz night, which could attract recent arrivals to the neighborhood, most of whom are white.

In the nightlife-intensive H Street corridor of Northeast, Douglas Memorial United Methodist Church seems to be taking a similar approach.

A decade ago, boarded-up storefronts were common. Today, Douglas is down the street from Boundary Road, a restaurant where President Obama dined with fundraisers this month. The church has fewer than 100 members, and space in its pews for 500.

Douglas, too, has recently finished a renovation that its pastor says will enable the church to better serve its community — and, ultimately, to grow the congregation.

“We are constantly trying to build relationships,” said the Rev. Helen Stafford Fleming. “We have parenting programs, Alcoholics Anonymous . . . soup kitchens and computer labs.”

Alton Pollard, dean of Howard University’s divinity school, said churches such as Douglas have the right idea. “It is making space available for the larger community,” he said. “Churches, by design, are supposed to be committed and part of the community.”

Terry Lynch, head of the Downtown Cluster of Congregations, said strong pastoral leadership is also crucial for “reaching out and embracing’’ new residents and new realities.

It often isn’t easy. Wesley says its new neighbors are welcome, but some recent arrivals complain about how church members double-park outside the church on Sunday mornings, or about how tough it is to get alcohol licenses for new restaurants. Murphy said the church’s relationship with its new neighbors is improving. But so far, the recruits haven’t really materialized.

At Wesley, which held services at another location during its renovation, “we have had about nine members join our church in recent months,” Shannon said. The church is trying to attract young people, Murphy said, and is considering using the pulpit as a training ground for seminarians.

Strolling along 14th Street one recent evening, Dan Wood and his girlfriend walked into Wesley after hearing a gospel choir inside. They were the only whites in an audience of about 60.

Wood, 23, a mapmaker, described himself as “passionate about racial reconciliation.” But he said some white people might be intimidated by the name of Wesley’s affiliation alone, being unfamiliar with it: African Methodist Episcopal Zion. He added that it’s not enough for anyone to want newcomers and diversity; they must communicate that message and shepherd it through.

“Changing the culture of a church congregation is difficult, even if you have inclusive services,” said Wood, who lives blocks away from Wesley but attends a church on Capitol Hill.

First Baptist Church of Georgetown is known for its outreach, and the church is stable as it celebrates its 150th anniversary.

Adapting to gentrification isn’t as much about the neighborhood as it is about the church’s commitment to serve, said the Rev. Robert Pines, First Baptist’s pastor. Among its other efforts, the church hosts an annual cookout for neighbors.

Last week, nearly a dozen people strolling in Georgetown ventured inside after hearing a gospel concert.

“We keep the doors open” during services and concerts, Pines said. “That’s intentional. People hear the music and they come in.”