When adding Google Analytics 4 support to a site that already has Universal Analytics, do I need both analytics.js and gtag.js, or is gtag.js enough?

I have a website that is running the Universal Analytics (UA) version of Google Analytics. I would like to add support for Google Analytics 4.

The documentation for adding Google Analytics 4 support asks me to add a gtag.js script to my web pages. If I want to continue using UA, do I need to use both analytics.js and gtag.js, or can I just replace the analytics.js tag with gtag.js because it will be enough to supply data to both UA and GA4?