Living with roommates when you're 25 is one thing. When you're 65, it's another story—but it's a reality for a growing number of older Americans. Middle-class seniors and the growing wave of baby boomers behind them want to stay in their homes and communities as they grow old, but escalating costs of everything from food to medication to property taxes; battered retirement portfolios; and dwindling savings have today's older Americans looking to become ad hoc landlords or tenants, even if the practice sometimes is forbidden by zoning restrictions.

Getty Images

"With high costs of living today, and diminished resources of seniors, renting and sharing excess space in one's dwelling will certainly call into question the relevance of current laws," said Robert Stein, president and CEO of the American Society on Aging, via email. Ultimately, while these kinds of arrangements can give seniors a richer life as well as financial stability, Stein said there were plenty of instances where people attempting these kinds of living situations had run afoul of authorities. "That's a big issue," said Rodney Harrell, housing expert at the AARP. "There are certainly going to be people who do what it takes to survive." More from NBC News:

Auto Recalls Could Hit Record Number This Year

Several College Presidents Earn More Than $1 Million

Could Future Soldiers Be 'Too Fat to Fight'?

Jackie Herships is one of them. "I guess I'm a bit of a risk taker," said the New Jersey resident who is willing to break the law to hang onto her five-bedroom house in an affluent suburb. As her neighborhood has gentrified, property taxes have risen and zoning laws have gotten stricter, turning the 72-year-old "semi-retired" writer and public relations professional into an underground landlord. "The laws have gotten, from my point of view, more onerous and more yuppie oriented over the years," she said. Since her neighbors know about her tenants, Herships said, she worries about being found out. "I'm very active in the community, which is a good thing, but it makes me very visible…. They could, someday, definitely turn me in," she said. Read More Take charge of retirement now—or be sorry later

Without her tenants, a group that has ranged over the years from a visiting Chinese academic to a retired publisher who Herships considers more like family, she couldn't afford to keep her house. "I've heard of people losing their homes," she said, after their clandestine rental agreements came to the attention of local authorities. If this happened to her, Herships worries it would leave other seniors who have lived with her—a former playwright who was tall enough to help with chores like changing light bulbs and drove Herships home after she had cataracts surgery, and a Buddhist nun who helped Herships navigate her house after breaking her foot—with no place else to go. Read More

She worried for herself, as well. "Let's say I was living here all by myself," she said of the aftermath of her injury. "Who's going to help me get to the bathroom or whatever I need?" Like many of today's seniors, Herships is still bearing the financial burden of a mortgage, and her renters contribute significantly to her income stream.