Cut the zucchini and squash into long, thin layers. Lightly grease a 7x11-inch baking dish and layer the squash, zucchini, onion and tomatoes into the baking dish.
Sprinkle with cheese and add pats of butter between each layer of vegetables, and season each layer with salt and ground black pepper to taste.
Continue this layering process until all the vegetables are used up and top this off with the remaining butter and cheese.
Cover and bake at 375 degrees F (190 degrees C) for 20 to 30 minutes, or until vegetables are to desired tenderness and cheese is melted and bubbly.