In many cities and states, local elected officials are stressed as they struggle to balance budgets after years of economic turmoil.

But in the District, which has largely escaped the full impact of the national recession, the stress of having too much money is starting to show.

In recent weeks, relations between the District’s two top elected officials appear to have worsened as the two men battle over who has the most control in spending an unexpected windfall in the city budget.

Late last year, D.C. officials reported an unexpected $42 million boost in revenue in the current fiscal year. Last week, the Office of the Chief Financial Officer disclosed a new audit that shows $240 million in savings in fiscal 2011, which Gray said makes the District the envy of cities across the country.

But Gray and Brown are clashing over who should take the lead in determining how excess funds are spent.

In a bitter hearing Monday, Brown’s relationship with the administration appeared to reach a new low when he accused it of hiding $42 million in unspent “special purpose funds” from the council.

Raising his voice with frustration, Brown suggested that Eric Goulet, Gray’s budget director, worked secretly with Chief Financial Officer Natwar Gandhi to keep the money under Gray’s control instead of allowing the council to weigh in on the matter.

“You cannot change the law of the District of Columbia,” Brown told Gandhi. “For you to be in cahoots with the mayor is unacceptable.”

Brown later said it was “a slap in the face” that Goulet did not bring the matter before the council. Brown also scolded Goulet for allegedly raising his voice at council staff during the hearing.

At issue is whether the council was properly notified after Gray officials discovered an additional $42 million in unused funds in the pot of money used for designated projects, including the Green Building Fund, the Sustainable Energy Trust Fund and the Workers’ Compensation account. Instead of keeping the money in designated accounts, Gandhi signed off placing the money in a holding account, Brown said.

When there are excess funds, Brown argued, the council needs to decide whether and how they should be diverted.

“It’s a slap in the face to this legislative body,” Brown said.

Gandhi apologized to Brown, saying he should have taken the matter before the council.

But Goulet said the issue stemmed from a “simple drafting error,” and that there there was no intent to mislead the council.

Goulet noted that the mayor couldn’t spend the excess money in several funds even if he wanted because federal law mandates that it be used for the purpose it was specified for. Furthermore, Goulet noted, the transfer of the money was initiated under a budget provision approved by the council last year.

“The chairman’s office was notified that this was a drafting error,” Goulet said.

Still, the dispute highlights growing tension between Brown and Gray over how to spend the city’s money.

Two weeks ago, Brown orchestrated a move to get 11 of 12 council members to publicly state that they oppose Gray’s effort to use part of the budget surplus to shore up some of the administration’s spending priorities.