Upvote:1
As your itinerary falls just short the requirements, the 96-hour visa on arrival does not appear to be an option. Additionally, your arrival and departure are at two separate airports.
Should you be flying either Etihad or Emirates, you can apply on the web site of either airline. Wikipedia also lists Air Arabia, Air Astana, Air Baltic, Air Serbia, flydubai, Turkish Airlines, and Indigo Airlines as airlines through which UAE visas can be arranged, but you should check and confirm with your carrier.
Otherwise, you would need to make arrangements for a visa prior to your journey.