Heat 3 tablespoons oil in a large skillet over high heat. When the oil is hot, add the mushrooms. Cook, stirring occasionally, until browned and tender, about 5 minutes. Push the mushrooms to one side of the pan and add the remaining tablespoon oil to the other side. Add the shallots to the oil and season everything with salt and pepper. Cook, stirring occasionally, until the shallots are tender, about 2 minutes.
Add the wine and cook, stirring and scraping up the browned bits in the pan, until the wine evaporates about 3 minutes. Add the sauce and bring to a simmer then reduce the heat to low.
While the sauce cooks, cook the gnocchi according to the package's directions. Drain and immediately divide among serving dishes. Top with the sauce and sprinkle with parsley. Grate the Pecorino on top and serve immediately.
You can use sliced cremini or white button mushrooms instead of wild mushrooms. For even more garlic flavor, add 2 minced fresh cloves along with the shallots. You can grate Parmesan on top at the end instead of Pecorino.