We have 24 unidentified tanks left, as 2 out of 5 represents 10 possible outcomes.
We repeat the process. Here, 24 is divided by 3, resulting in 8. And 8 is divided by 2, resulting in 4. Accordingly, 2 units were taken from each tank again.
The first person drank from tanks 1-8, 9-12, and 17-20.
The second person drank from tanks 1-4, 9-16, and 21-24.
The third person drank from tanks 5-9, 13-16, and 17-24.
In total, we'll have to discard 4 tanks, but I can't think of a better solution. Or, we can experiment with the remaining survivors if they don't die within 12 hours.
Added 2 minutes later
Ment seems to be right. It is indeed possible to determine the poison even in 243 barrels. I took 240 for a round number. I'll check again just in case.