Preheat oven to 350 degrees F (175 degrees C). Grease a 12-cup muffin tin lightly or line cups with paper liners.
Stir flour, sugar, cocoa powder, 1 teaspoon cinnamon, baking soda, 1/2 teaspoon cayenne pepper, and salt in a large bowl. Add water, applesauce, vegetable oil, vanilla extract, and vinegar; mix until batter is smooth.
Spoon batter into the prepared muffin cups, filling each 3/4 full.
Bake in the preheated oven until tops spring back when lightly pressed, about 25 minutes. Transfer to a wire rack and let cool, at least 15 minutes.
Place chocolate and margarine in top of a double boiler over simmering water. Stir frequently, scraping down the sides with a rubber spatula to avoid scorching, until chocolate is melted, about 5 minutes. Stir 1 teaspoon cinnamon and 1/2 teaspoon cayenne pepper into the frosting.
Spoon frosting over the cupcakes and swirl around to cover the tops.