I mean, that's fine if you discuss it up front with the company before heading on site. You severely limit your options, but I know a few companies that have agreed to payment.
Though, it's worth noting that the company is already spending a lot of money interviewing you. Especially if they're paying for flights, lodging, and meals for an on site.
It's worth figuring out what your goals in demanding compensation for being interviewed are. If it's making sure the company isn't "taking advantage" if your time, then I think that's already covered (interviews are super expensive expensive for companies) so long as 4 of those 5 hours are with actual humans. If it's due to financial hardship, most companies will be sympathetic and work with you. If it's to satisfy a sense of moral righteousness, then I think there are better options than sending and invoice after the fact (which comes across as passive aggressive and would ding you on your communication skills assessment)
If you're going to "assess" me for 5 hours, I'm going to send you an invoice for 4 hours with 1 hour special discount for special fwend.