Preheat the oven to 325°F (160°C) or 300°F (150°C fan) about 8–10 minutes before you put the cake in the oven.
Line a 9×5-inch (23×13 cm) loaf pan with parchment paper.
Dry ingredients: In a bowl, whisk together the flour, baking powder, baking soda, pumpkin spice (or cinnamon), and salt.
Pumpkin mixture: In another bowl, whisk pumpkin purée, eggs, sugar, oil, milk, yogurt (if using) and vanilla extract until smooth.
Combine: Add the dry ingredients to the pumpkin mixture and fold gently until smooth. Do not overmix.
Make the chocolate batter: Scoop out about 1 cup (260 g) of pumpkin batter into a separate bowl. Add cocoa powder and milk, then whisk until smooth.