Alliance members rank 3 and above can declare war on other alliances.
For you to be able to declare war on an alliance, they need to control territory of their own. If your alliance also controls territory, you can declare war freely.
If your alliance does not control territory, you'll have to spend GEC to force declare on the enemy. The amount of GEC required depends on the alliance level of the target alliance.
To declare a war, view the target alliance's information page and select "Declare War". To find this page for alliances with territory, view one of their controlled systems on the system map and click in the lower left corner on the icon with their flag. Their information page will open.
After declaring, there is a 12-hour preparation phase. Upon declaration neither side will be allowed to move fleets to inside the enemy's territory.
After preparation, the war will start for a period of 24 hours, or until one side earns a complete victory. During this time, alliance defenses are active and alliance buildings can be attacked.
After the war ends, there is a treaty period of 3 days during which the declaring side cannot declare war on the defending side again. However, the defending side in the previous war can freely declare war on the declarer as soon as the war ends.