The main criteria that you need, in order to multiply by a matrix on a quantum computer (in the sense of permuting the states, not in the sense of adjusting the amplitudes) is for the matrix to have an inverse. You can find this inverse by performing Guassian elimination. Performing the Guassian elimination spits out exactly the operations you will need to perform, in reverse.
Let's do the Guassian elimination of $M$:
r2 -= 2*r1
r3 -= 3*r1
r1 -= r2
r3 -= r2
r1 -= r3
We managed to reach the identity matrix. Note that we didn't need to compute any multiplicative inverses in order to make the rows cancel properly or to make elements along the diagonal equal to 1, which is good because it means we can multiply by this matrix modulo any $n$. That won't always be the case.
If you run these operations backwards (reverse order and += instead of -=), you will turn the identity matrix into $M$. Run them backwards against a vector, and you are multiplying by $M$.
For example, here is a circuit which multiplies by $M$, working modulo 8:
The first column is preparing an input state to test it, the second column is green state displays showing the prepared value is [1, 2, 3], the final column is green state displays showing the output (modulo 8) is [6, 6, 7]. All the stuff in between is the reversed Gaussian elimination operations.