You installed system gcc compiler. Your original question was how to install gcc-4.8xx. If you are using pkgsrc the easiest thing is
make install clean clean-depens
Note that NetBSD has multiple versions of gcc compiler the 2.9.5 probably the most useful and the last truly portable gcc version. The first place to check
for pkgsrc package is
you also want to read documentation on pkgsrc
NetBSD also has new binary packaging system pkgin which is very similar to Yum and apt-get but I am not a regular NetBSD user so you would want to check documentation how to use pkgng
comppackage, you should have gcc. You say that "gcc is still not able to compile simple programs." What does that mean? What errors do you encounter?