Higher‐order Bragg coupling in periodic media with gain or loss