I'd say it depends on how that $5000 compares to your emergency savings. If you have low emergency savings, I would be more concerned about paying off all possible debts to reduce loss from interest payments. That's because I would consider the risk to principal needed to obtain an investment return comparable to your interest rate too high in the short term, when I may need that principal for emergencies.
Conversely, if you have quite a bit of savings, you may be better able to weather losses on investments and in the long term come out (slightly) ahead. Then it becomes a question of whether you are alright with still having a debt or not.