1. Preheat the oven to 375ºF (190ºC.) Lightly brush or spray an 8-inch (20cm) porcelain mold or cake pan (not a springform pan) with oil.
2. Smear the dulce de leche around the bottom and up the sides of the pan. Place the mold or cake pan in a larger roasting pan, which you’ll use as a double boiler for baking.
3. To make the cake layer, whisk together the sugar, flour, cocoa powder, baking soda, baking powder, and salt in a large bowl.
4. In a small bowl, whisk together the buttermilk or yogurt, vegetable oil, 1 egg, and vanilla.
5. Use a spatula to stir the wet ingredients into the larger bowl of dry ingredients, mixing just until combined. Scrape the batter in the mold, over the dulce de leche.
6. Make the flan layer by blending together the evaporated and condensed milks, the 4 eggs, the vanilla, and salt, until smooth.
7. Over the back of a large spoon (like a big mixing spoon), pour the flan mixture over the cake layer, using the spoon to diffuse the custard as you pour.
8. Cover the mold or cake pan loosely with foil, fill the roasting pan with very hot water, so it reaches halfway up the side of the mold, and bake for 50 minutes, or until a knife inserted into the center comes out relatively clean.
(Note: I found the flan took considerably longer to bake than 50 minutes; mine took practically an 1 1/2 hours. So being checking it at 50 minutes, but note that it may take longer.)
9. Once done, remove from the oven and carefully lift the custard out of the water bath wearing oven mitts, then let the flan cool to room temperature. Then refrigerate the flan until ready to serve.