Heat 2 tablespoons olive oil in a large, cast iron skillet over medium heat. Add onions and cook until translucent. Turn heat to medium low and cook, stirring occasionally, until onions start to caramelize, about 15 minutes.
Turn heat up to high again and add in mushrooms. Cook until mushrooms begin to leach out water, season with salt, and cook for about 15-20 minutes, until mushrooms have softened and most of the liquid is gone. Stir in garlic and red pepper flakes and cook for an additional minute. Remove from the heat, taste and adjust salt, and stir in the parsley, 4 ounces goat cheese, Parmesan, and freshly ground pepper to taste.
Wipe out skillet with clean paper towel. Add one piece of phyllo dough to skillet, brush lightly with olive oil, then add the next. Continue until you've used up all the phyllo dough. Add mushroom mixture, and top with remaining 1 ounce goat cheese. Brush edges of phyllo lightly with oil and fold over filling, overlapping slightly, leaving center exposed.
Cook pie over medium heat until bottom of pastry is slightly golden, about 3 minutes. Transfer skillet to oven and bake until phyllo is a crispy golden brown, about 20–25 minutes. Let pie cool slightly, then cut into wedges and serve.