Preheat the oven to 375 degrees f. Mince the garlic and onions.
Slice the tomatoes and arrange them in a single layer on a paper towel to absorb the excess moisture.
Heat olive oil in a skillet over medium-high heat. Once the oil is hot, reduce to medium heat. Add the onions and garlic; cook until they begin to turn soft and remove them from the heat.
Whisk the eggs together in a small mixing bowl, then whisk the cheese into the eggs.
Add the cooked garlic and onions to the egg/ricotta mixture.
Pour the mixture into a pie plate coated with oil; sprinkle with half of the mozzarella cheese and arrange the tomato slices in a single layer on top.
Bake for 45 minutes.
Remove the pie from the oven, sprinkle with the remaining cheese and bake 5 minutes longer to melt the cheese.
Add fresh chopped basil and allow the pie to rest for 5 to 10 minutes before slicing.