Heat oil in a large skillet over medium heat. Add garlic and cook, stirring occasionally, just until it starts to brown around edges, 30 seconds to 1 minute. Add tomatoes, 2 teaspoons salt, and basil; simmer until tomatoes have broken down into a loose sauce, about 20 minutes.
Make a well in tomato sauce with the back of a large spoon and crack 1 egg into well. Repeat with remaining 5 eggs. Season with salt and pepper and cook until whites are set and yolks are cooked as desired, about 25 to 30 minutes. Top with cheese and serve with sauce immediately from the skillet.