Yes, you remember correctly: The equivalence relation here is $a \sim b \iff a \equiv b\pmod 5$
Another ways of saying this is that $a\sim b \iff a-b \equiv 0 \pmod 5$.
Every integer $n\in \mathbb Z$, when divided by $5$, has one and only one of the following remainders: $0, 1, 2, 3, 4$. Those elements that have a remainder of $0$ form one class (are mutually related); those elements that have a remainder of $2$ form another class; $\cdots$; and all those elements that have a remainder of $4$ form the final class.
That is, every integer belongs to one and only one of the equivalence classes: $[0] = I_0, [1] = I_1, [2] = I_2, [3] = I_3, [4]= I_4,$ such that the classes are mutually disjoint.
So, since every integer is an element of and only one equivalence class, we have a partition of $$\mathbb Z = \{I_0, I_1, I_2, I_3, I_4\}$$