That complicates things. I have never used the q2-network plugin, so I can't tell you how to deal with that. However, the general approach should still remain the same: join users and posts table, filter for users whose post count is 0 and who either never logged in or last logged in $TIME ago, return the resulting user IDs, delete users with those IDs.
If you want to be on the safe side you could just report the to-be-deleted IDs in a first step and verify across your sites that none of them is an active user. Then delete them in a second step.