In conclusion, if you can connect to a database from Node.js then you can likely use it as a custom database connection. Having said that the documentation you linked suggests that access to OpenShift databases from the outside can be done, but more on a temporary basis for administrative reasons:
…how to use port forwarding to temporarily expose a database outside of OpenShift, allowing you to access it from a database tool running on your own local machine.
Databases deployed to OpenShift will typically be used to support the operations of a front-end web application, and therefore only need to be accessible by other applications running in the same OpenShift cluster.
In conclusion, if you can access it from the outside (regular Internet) you can access it from within a custom database, but you should check if OpenShift databases are really intended for that use case.