City Comptroller Alan Hevesi said the boom that produced a record surplus of $3.192 billion last year will give way to a tiring economy and new spending needs that could spill red ink everywhere.

He predicted a gap of $2.45 billion in 2002, growing to a “worst case” scenario of $4.98 billion in 2004.

Among the bigger bills facing the city: $1.1 billion in pension improvements; $830 million in new spending mandated by the state; $345 million in new City Council initiatives; and $146 million in higher energy costs.

The state Financial Control Board issued a similar warning, although it forecast smaller deficits over the next three years: $2.5 billion to $3 billion.

Two days earlier, state Comptroller Carl McCall provided his own projections, which showed budget gaps of as much as $4.7 billion by July 2003.

Giuliani took a slap at the control board, saying “maybe [it] does not understand completely the budgeting that we do and why we do things the way we do it.”

But he wasn’t about to let slip an opportunity to use the numbers to his advantage.

The administration is in tense contract talks with several unions, with cops demanding a 39-percent economic package over two years.