Beat eggs, sugars, and vanilla in a large bowl with an electric mixer at medium speed until pale and thick, 3 to 5 minutes. At low speed, mix in melted chocolate until incorporated, then add flour mixture in 3 batches alternately with sour cream, beginning and ending with flour mixture and mixing until each addition is just incorporated. Spread batter evenly in pans and rap pans several times on counter to eliminate air bubbles.
Make frosting and assemble cake:
Whisk together sugar, flour, cocoa powder, and a pinch of salt in a small heavy saucepan over medium heat, then add milk and cook, whisking constantly, until mixture boils and is smooth and thick, 3 to 5 minutes. Remove from heat and whisk in chocolate and vanilla until smooth. Transfer to a bowl to cool to room temperature, covering surface with parchment paper to prevent a skin from forming.
Cut each cake horizontally into 2 layers with a long serrated knife. Put 1 layer on a cake stand or large plate and spread top with 1 1/4 cups frosting. Repeat with 2 more layers, then add remaining layer and spread top and side of cake with remaining frosting.
Cake layers can be made 2 days ahead (but not split horizontally) and kept, wrapped tightly, at room temperature.
Frosting can be made 2 days ahead and chilled, covered. Bring to room temperature (about 1 hour) and beat until fluffy before using.
Cake can be frosted 1 day ahead and chilled, covered.