Just as you can purchase from the black market, you can also quickly sell your excess goods to it, though for significantly lower returns.
As is the case with buying, having a large percentage of your empire occupied by Markets and Keeps will increase the selling prices of military units to up to 50% of their usual purchase price.