How to add Adsense code in between posts?

I am using the Genesis Framework for my coupon website. I am using the function genesis_custom_loop to create WordPress posts loop.

Reference for genesis_custom_loop:

I wanted to add Google Ads in-feed ads code for every 5 posts (coupons). I don’t want to use the Auto Ads feature as it places ad in any random location and disturbs navigation.

How to add AdSense code for every 5 posts (coupons)? How can I achieve this?