Cook the filling: Heat 1 tablespoon of olive oil in a large pan at medium heat. Add the chopped onion and cook, stirring frequently, until translucent, 4-5 minutes. Add the spinach, salt, and pepper. Cook it, tossing it every few minutes using kitchen tongs, until the spinach loses most of its volume, around 5 minutes. Give it a stir and turn the heat off. Let it cool for 15 minutes.
Preheat the oven to 350 degrees F.
Make the yogurt milk mixture: Whisk olive oil, milk, egg, yogurt, salt, and black pepper in a bowl until combined.
To assemble: Line a baking sheet (mine is 12X17) with parchment paper. In a single layer, place sheets of phyllo dough onto the parchment paper. Use as many sheets as you need to make sure that the pan’s whole surface is covered. It is okay if some filo is overhanging on the sides.
Place another layer of phyllo on top of the first, again making sure that the bottom of the pan is covered. Pour 3-4 tablespoons of the milk mixture on the top layer of dough and brush it over the filo sheets, making sure that it is evenly spread.
Stack another two layers of phyllo dough on top of the first two. Again, brush the milk mixture over the top phyllo sheet. Then, cover the top sheet with one more layer of phyllo dough—not two. Do not brush the top sheet with the milk mixture again.
Spread the now-cooled spinach and crumbled feta cheese evenly over the top layer of phyllo sheets.
Place another two layers of phyllo sheets over the filling, covering it completely. Brush another 3-4 teaspoons of the milk mixture over the topmost sheet. Then, place two final layers of phyllo dough on top of the washed layer, and brush the top with the milk mixture. You should have 9 layers of dough in total.
If there are sheets overhanging on the side, fold them in towards the pastry’s center and make sure that they are brushed with the milk mixture. At this point, the borek should look nicely moist and tightly packed.
Using a sharp knife, pre-slice borek into 12 equal pieces (please refer to the video for a visual).
Mix egg yolks in a bowl.
Brush each slice with egg yolk and sprinkle with sesame seeds and nigella seeds if using.
Bake in the oven for 30-35 minutes or until it turns golden brown.
Let it cool for a few minutes, slice, and serve while it is still warm.