I’d respond with a “you could, but should not”: As outlined in the KB linked article below, 9.6 should remain installed after upgrading to UCS 5.0.x.
It should even continue working - with a big “but”: Univention will not continue shipping bug- and security fixes for PosgreSQL 9.6 on 5.0.x as it isn’t available in that version anymore. Do check if your ERP is really tied to this version branch of PostgreSQL or if it supports newer versions by now, then test and plan your upgrade to 5.0.x and PostgreSQL 9.6 to 11.
Check out this KB article here: Updating from PostgreSQL 9.6 or 9.4 to PostgreSQL 11