In both cases, the answer is that the great bulk of the financing for the war came from borrowing. This was much easier for the North, with its greater industrial capacity, which made it a better risk for lenders. The South also did a lot of simply printing more money, which was a way to finance the war, but was also disastrous in terms of creating inflation.
As you can see from the eh.net link below (you have to scroll down a ways to get to the part of financing), both the Union and the CSA had to borrow a great deal of money. The USA did get money from excise taxes and tariffs and from the first-ever income tax, but that was not anywhere near to enough money. As a result, it had to get about 75% of the cost of the war from either borrowing money or simply printing more. Luckily for the North, it needed to do only a little printing of money as the war went on. By contrast, the South had to rely heavily on printing money. The CSA had a very hard time borrowing, especially as the war went on and it looked less likely to win.
The war, then, was paid for largely by borrowing. The South also had to print huge amounts of money while the North was able to raise at least a significant percentage of its war costs through taxation.