Preheat oven to 350 degrees F. Bring a large pot filled with water to a boil. Fill a large bowl with ice and set it aside.
Place the pie crust into a pie dish and bake for approximately 25 minutes. If you pie crust has directions for pre-baking on the box, then feel free to follow those directions instead.
Cut two 2" slices in the bottom of each tomato to make an X. Carefully place the tomatoes into the boiling water. Boil for 5 minutes.
Remove the tomatoes from the water, and place in the bowl filled with ice.
Drain the water from the pot and wipe it out with a towel to remove any residual water. Set the pot over medium heat and add the olive oil and onion to the pot with a pinch of salt. Cook on medium for 20 minutes to cook the onions, stirring occasionally.
Remove the skin from the tomatoes. It should peel off easily with your fingers. Slice the tomatoes and place each slice on a towel lined baking sheet to drain. Sprinkle with salt. Let sit for 20 minutes while onions cook.
Sprinkle ½ cup of the gruyere onto the bottom of the pie crust. Spread the cooked onions on top of the gruyere. Alternate adding layers of tomatoes with a sprinkle of basil, pinch of salt, and pinch of pepper on top of each layer until you run out of tomatoes.
Mix the remaining ( 2 cups ) of gruyere with the mayonnaise and ¼ teaspoon pepper. Spread the mixture on top of the last layer of tomatoes.
Bake at 350 for 45 minutes or until the top is browned.