Perhaps the biggest variable in your situation is how long it will take you to pay off the credit card. For example, if you can pay the credit card balance off in five months, you’ll only end up paying about $300 in interest, which is just 6% of the $5,000 you need. Meanwhile, the IRA early withdrawal penalty is 10%.
On the other hand, if you can only afford to pay say, $200 per month, it will take three years to pay off the balance and you’ll pay about $2,000 in interest, or 40% of the amount you’re borrowing.
Mathematically speaking, in the first scenario, you’re better off using a credit card. In the second, it’s probably a better idea to just pay the early withdrawal penalty.
As a final thought, another variable to consider is that by taking money out of your IRA, you’re effectively robbing your future self. You can’t put the money back into your IRA at a later date, and an early withdrawal could have a huge effect on your future retirement wealth.