On a PC, RetroPie will need an X server to run and you should have that functioning before starting the installation.
The dependencies are just a few small packages (libSDL mainly and a few other libs) and on a straight Ubuntu install the base RetroPie install should be less then 800 Mb. However, since installation on a PC will compile everything, quite a few -dev packages will be installed (mostly X related) and take space during the installation itself - you can remove them after installation is finished.
If you add more emulators, the RetroPie installation might take more space, but not considerably. I expect the ROM folder and the scraped artwork (video/images) to take (a lot) more than a RetroPie install. If you managed to get your base installation under 5 GB, I think the installation to be fine and still have space to spare. Make sure you have a supported distro - Debian/Ubuntu.