Nextcloud and Onlyoffice are two different applications and must be accessible from outside (look at Collabora integration guide to understand how wopi protocol used for Office integration in Nextcloud works).
Best way to expose 2 applications using one public IP a reverseproxy which would be the target for port forwarding and terminate incoming connection and depending on the destination (e.g. using SNI) forward the request to the respective system.