WASHINGTON—The federal budget deficit appears to be narrowing slowly but steadily, as corporate and individual income taxes rise thanks to the rebounding economy.

The Treasury Department reported Wednesday that it collected $171 billion in taxes and other revenue last month, the highest March tally since 2008, when Bear Stearns was acquired at a government-run fire sale by J.P. Morgan Chase & Co.

Individual...