Dogs chasing horses is a zero tolerance issue to me. Barking at the horses included.
Mine are not allowed in stalls or in a pasture without permission.
Generally a very firm NO and if it is still an issue then dog goes in tack room, crate, etc. No electric, but mine have fairly good obedience.
Allowing him to bark/ harass across the fence should be stopped.