No better don’t do that.
In my opinion the best upgrade path (with enough “safeties” inside) would be:
2.1 → 2.4
2.4 → 3.0
3.0 → 3.4
3.4 → 4.0
4.0 → 5.0 (stable)
While that’s a good idea it won’t work for all migrations and will, if very unlucky, leave your database in a dirty state for those migrations that require specific versions of the code. Theoretically major to major should be good enough, if you want to be extra sure use above mentioned path and, as long as your database is all right right now, you’ll be fine.
You may want to run zammad run rake db:migrate before updating anything.
An important warning:
Zammad 5.0 enforces specific database versions.
For this reason you may want to upgrade to 4.1 and then migrate into a current Debian 10 (as 11 is not yet supported). Theoretical Debian 9 should be good to go already, but you could raise your pgsql version greatly.
Note that your ES version most likely is no longer supported. If nothing else connects to it consider killing it completely (remove data directories) and reinstall a supported version. You can skip that if you migrate onto a new host with 5.0 anyway.
In between your migration steps you technically can skip the searchindex rebuilds for speeding the process up.