Preheat oven to 350 degrees. Butter a 9-inch square baking pan or dish. Line bottom of pan with parchment paper; butter lining.
Melt chocolate and butter in a heatproof bowl set over a pan of simmering water, 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.
Divide batter between two medium bowls (about 2 cups per bowl). Stir chocolate mixture into one bowl. In other bowl, stir in pumpkin, oil, cinnamon, and nutmeg. Transfer half of chocolate batter to prepared pan smoothing top with a rubber spatula. Top with half of pumpkin batter. Repeat to make one more chocolate layer and one more pumpkin layer. Work quickly so batters don't set.
With a small spatula or a table knife, gently swirl the two batters to create a marbled effect. Sprinkle with nuts.
Bake until set, 40 to 45 minutes. Let cool in pan on a wire rack. Cut into 16 squares.