As far as I know you can do this however like Max said it is very risky. As the site isn’t under your control you’re not responsible for traffic going to the site meaning that your ads could be venerable to invalid clicks.
Also it would be very easy for your users to just remove your banner code from the script.
Its not worth the risk of loosing your adsense account for the extra few cents you would get each month.