Preheat the oven and prep the baking dish - Preheat the oven to 400℉, and spray the inside of your baking dish with olive oil.
Prep the veg - Destem the squash and cut it into cubes. Trim any eyes or other blemishes on the potato. Cut it into quarters lengthwise, then thinly slice each quarter across. Toss the squash and potatoes to combine.
Build the gratin - Layer the veg and the goat cheese, beginning and ending with the vegetables, salting and peppering each layer. Pour the milk over the layers, and sprinkle the gratin with Parmesan.
Bake - Bake, covered, for 40 minutes. Uncover, and bake another 20 minutes more, or until the veg is very soft.
Finish and serve - Drizzle with basil pesto, and serve.