No, you shouldn't thank each of them with an individual comment. This is because if, as you say, there are 5 people who helped you then you would be posting 5 comments, which is a lot of noise. You are better upvoting the helpful comments, and maybe also posting a general "thanks!" comment, which they can read if they want to*.
There are a number of reasons for this, and for full gory arguments I direct you to this meta.SE question and its answers. Fundamentally though, its a matter of site philosophy, and is underlined by the fact that greetings in questions (like "hi!" etc.) are automatically removed, while "the thanks parts at the end of posts" are left in simply because they "are much more difficult / risky to detect".
Let me highlight what I think is the main argument in the meta.SE discussion, which is taken from the accepted answer:
If this is supposed to be a website which is servicing more than just the primary author, we need to think about how we construct messages so that they appear more clearly to those searching on search engines for questions that match their own. If I am looking for a solution for question X, I want to find someone who had the same problem, not their short autobiography and formalities before getting to that actual question.
So 5 messages saying "thanks!" is a nice gesture, but future readers don't care about this, and in fact your comments may detract from the original, helpful comments.
*I will often revisit posts I have interacted with to see how they are going on, as a form of procrastination. I guess other people act similarly.