Probably the correct thing to do is to go, but what the other answers are missing is that it depends on the culture of your country/industry/workplace.
If it's a team lunch, being paid for by the company, then almost certainly you should go. As other people have said, it's a good networking event with your colleagues who are staying.
One of the other alternatives is that the person who's leaving is buying everyone a round of drinks. (This is common in a couple of companies I've worked for.) Although they probably wouldn't mind buying you a drink, I guarantee it will make you feel awkward! (Whether you get included on the round, or refuse and say you'll get your own, it's going to be socially awkward for you. Some people wouldn't find it awkward, but by the very fact you've asked this question you're clearly not one of them.)
So, how to find out? Ask someone you trust at the company. This might be someone who was assigned to settle you in (show you where the kitchen is, tell you how to work the IT system), it might be your colleague who sits next to you, or it might be your manager. If you ask them "Should I go to this event? I don't know the person leaving and I don't want to put them out at their celebration", you'll find out very quickly what the culture is like at your company. And they won't be surprised by the question either, it's a very natural question to ask.