I have been trying to do something similar. It's especially frustrating since Instant Apps already has such a Basemap Toggle, which you can also reposition on the map in Instant Apps.
I wish Instant Apps and Experience Builder shared more functionality, since they're both based on the 4.x JS SDK, or if you could create a prototype in Instant Apps, then open it in Experience Builder for fine tuning.
After reading this and other posts, it appears I'll need to install the Experience Builder Developer Edition, which kind of defeats the purpose of using ArcGIS Online.