At least 20 unique accounts need to raid at that gym over the course of the week. It doesn't matter if it's a tier 1 or a tier 5, just 20 different accounts.
Edit: Let's say you have 10 accounts for a tier 5 raid on Monday. Then on Tuesday and Wednesday, 9 more different accounts fight raids in that gym. Then on Thursday, 1 different account fights another raid. You should get an EX pass that week.