Long before it finally died last month, the old, rusted boiler in the basement of the five-story apartment building in the Bronx needed to go. It routinely broke down, leaving tenants without heat or hot water. It burned through copious amounts of heating oil and ran up thousands of extra dollars in bills.

But the old boiler stayed in the building, at 2629 Sedgwick Avenue, because the owner, Workforce Housing Group, an affordable-housing developer, said it could not afford to pay $400,000 to replace it after taking over the property in 2012. “Before we got to the building, the boiler was a mess,” a partner in the group, John Crotty, said. “And it’s not a unique situation to this building or to this area.”

The Bronx is dotted with aging apartment buildings that have weathered the changing economic and social landscape of the borough and today offer some of the most affordable rents in New York City. But unlike newer housing developments, which routinely include green technologies, many of these buildings do not have the resources to undertake major repairs and renovations to make them more energy efficient and to improve living conditions for tenants.

So the Bronx borough president, Ruben Diaz Jr., has teamed up with city housing officials to create a program that will help those buildings pay the upfront costs for energy improvements, such as replacing an old boiler, insulating windows or installing solar panels on the roof. In return, the building owners agree to use future energy savings to keep rents affordable for tenants and pay back the program through leasing fees for the equipment. “This is the type of thing that really sells itself,” Mr. Diaz said.