Preheat the oven to 350°. Lightly butter a 9-by-13-inch baking dish. Cook the spaghetti in a large pot of boiling salted water until al dente. Drain well and spread the spaghetti on a baking sheet; let cool.
In a large bowl, toss the Fontina with the mozzarella and Gruyère. Spread one third of the spaghetti in the prepared baking dish in an even layer. Sprinkle 1/3 of the mixed cheeses and half of the Gorgonzola over the spaghetti and season with salt and pepper. Repeat with another layer of spaghetti, mixed cheeses, Gorgonzola and salt and pepper. Top with the remaining spaghetti and mixed cheeses.
Bake the spaghetti in the center of the oven until the top is golden brown, about 40 minutes. Let cool slightly before cutting into squares and serving.