Probing intergalactic radiation fields during cosmic reionization through gamma-ray absorption