Minecraft wiki entry for Fence_Gate, associated text: an adjacent active power component, including above or below: for example, a redstone torch, a block of redstone, a daylight sensor, etc.
an adjacent powered block (for example, a block with an active redstone torch under it), including above or below
a powered redstone comparator or redstone repeater facing the fence gate
powered redstone dust configured to point at the fence gate or a directionless "dot" next to it; a fence gate is not activated by adjacent powered redstone dust that is configured to point in another direction.