Preheat oven to 350℉.
Place sliced tomatoes and onions in a single layer in a colander or on wire racks placed over rimmed baking sheets; sprinkle with salt. Let sit for 1-2 hours to release moisture.
Blot excess moisture with cotton or paper towels (be sure to remove as much moisture as possible without crushing the tomatoes and onions).
Arrange one layer of tomatoes on the bottom of the cooled pie crust, overlapping the slices. Add half of the onion on top. Sprinkle with half the garlic, half the basil, and ¼ cup of the cheese. Season with freshly ground black pepper to taste. Repeat layering with remaining tomatoes, onion, garlic, basil, and ¼ cup cheese.
Mix the remaining 1½ cups of cheese with the mayonnaise, dollop on top of the pie and gently spread around (see notes for tips on spreading).
Bake in the preheated oven until cheese is melted and bubbling, about 30 minutes. Allow to cool for 10-20 minutes on a wire rack before slicing.
Serve warm and refrigerate any leftovers.