Layered Pumpkin and Cheese Gratin Squares (Boureki)

Boureki cut from a traditional Cretan gratin may be eaten at room temperature, but they are especially irresistible when the cheese is still warm.