There are a bunch of ways to do this and the ability to do it with Nextcloud is already baked in.
In the SCALE GUI to go Credentials>Cloud Credentials and click add. For provider choose WebDAV. Then you'll get a list of supported WebDAV providers - Nextcloud is the default. The rest (url, username, etc.) is self explanatory.
Once you've configured your Nextcloud credential head over the Data Protection menu >Cloud Sync tasks. Set up a new sync task using the credentials for Nextcloud you previously set up, choose the folders you want, etc. and there you have it.
There are other ways to do this via SSH, or setting up an S3 target on one system, and so on but if you are already hosting a working Nextcloud instance on your TrueNAS server the above is the simplest way to do it.
Edit: Simplest way assuming you are just wanting to back up certain files/folders on one system to a Nextcloud instance on a remote system, that is. If you are looking for full system replication then as Captain Morgan pointed out that can be done with ZFS snapshots on one system being replicated the other. That will take a little more setup as far as insuring you can ssh between the two but works quite well.