Preheat oven to 350 degrees. Butter a 9-inch square baking pan or dish. Melt chocolate and butter over low heat, stirring occasionally until smooth. Whisk together flour, baking powder, cayenne, and salt in a large bowl; set aside.
Put sugar, eggs, and vanilla in the bowl of an electric mixer fitted with the paddle attachment; beat until fluffy and well combined, 3 to 5 minutes. Beat in flour mixture.
Pour half of batter (about two cups) into a separate bowl and stir chocolate mixture into it.
In other bowl, stir in the pumpkin, oil, cinnamon, and nutmeg. Transfer half of chocolate batter to prepared pan smoothing top with a rubber spatula.
Top with spoonfuls of chocolate and pumpkin. With a small spatula or a table knife, gently swirl the two batters to create a marbled effect. Be sure to get your knife all the way to the bottom of the pan. Bake until set, 40 to 45 minutes.