Melt chocolate and margarine together in a saucepan over low heat. Remove from heat and cool to room temperature.
Beat half of the sugar and egg yolks together in a large bowl with an electric mixer until light and fluffy. Stir in chocolate mixture until just combined.
Beat egg whites in a separate bowl with an electric mixer until foamy. Gradually add remaining sugar, continuing to beat until stiff peaks form.
Spoon 1/3 of the chocolate mixture onto beaten egg whites using a rubber spatula. Gently run spatula around the edges of the mixture lifting the bottom up and over the center, repeating until well incorporated. Add remaining chocolate mixture, folding just until batter is smooth. Pour 3/4 of the batter into a 9-inch square pan.
Bake in the preheated oven until edges are puffed and surface is firm, about 25 minutes. Set pan on a wire rack and allow cake to cool to room temperature, about 30 minutes. Spread remaining batter over cake. Refrigerate until completely chilled, at least 30 minutes more.