Heat oil in a skillet. Add the chopped onion and cook until softened, about 2 minutes. Then add the minced garlic and red pepper flakes; stir for about 1 minute until fragrant.
Stir in the mashed tomatoes along with their juice. Season with dried oregano, salt, and pepper, and let the sauce simmer for about 10 minutes until it thickens slightly.
Make 4 small wells in the sauce with the back of a spoon. Carefully crack one egg into each well. Sprinkle 1 tablespoon of grated Parmesan cheese evenly over the eggs. Cover for 5 minutes.