You have captured the gate. However, the enemy managed to prepare a counterattack from multiple directions. Hold your ground and destroy all enemies.
A teleport has been activated. Summon additional units, preferably Infantry and Cavalry. A Mage is also useful here - hide him behind the walls and defend the gate. Summon units and place them in front of the gate on its western side. This is the best spot for defense because you can use Cavalry and Ballistae. The enemy attacks from 3 different directions: west, north and east. The most difficult wave comes from the north. The small groups of Elves (higher difficulty levels add more units to them) will come from the east. The western group consists mostly of Archers. This means that there is no point in fighting in the forest. Your Cavalry won't be able to use Charge, ranged units' reach gets obstructed and the enemy can move swiftly in that type of terrain. Better wait for them to get out of the forest and enter your units' range of attack.
Placing one of the Ballistae in the northern tower during the first few turns is very important. Thanks to that you can shoot enemy units, including Ballistae, that are on the northern road. The enemy will regularly approach you with Archers and Ballistae. A faction that attacks first wins. You can cast Shield on a unit that is on the tower to help it survive for a little bit longer. Don't forget about the Healer, she can heal wounded units. Don't wait for the enemies to get down the slope. Instead, attack them with Ballistae and then finish off with Cavalry. After that you have to move as many units on the wall as possible so you will be able to defend from the last attack that will come from the east.
Playing the mission on a higher difficulty (orange markings on the map) requires even more effort because each of the groups gets additional units. The group that gets the biggest number of units is the one from the east which means that defending the gate is crucial. Be sure to summon additional Crossbowmen and Catapults units. Ultimately, you can decide to leave all units on the walls and move the rest of your forces on the left side of the gate (however, this is a risky move). The best way to win is to face the enemy on the western outskirts. Use Mages to freeze enemies and Ballistae to defeat them.