Prepare a 9x9 baking dish by greasing with butter and lightly coating with some flour to ensure the cake does not stick. Preheat your oven to 350℉.
In the bowl of a stand mixer fitted with the paddle attachment combine the sugar and softened butter on medium until combined very well. Stop and scrape down the sides with a rubber spatula as necessary.
Add in your eggs and mix again until combined very well and some air is incorporated (about a minute - as this is mixing you can prepare the next two steps), scraping down sides as necessary.
In a separate bowl mix together your milk, lemon juice, and vanilla and set aside.
Sift together your gluten-free flour, xanthan gum (only if your mix does not contain it), baking powder, baking soda, and salt into a medium-sized bowl. Then whisk in your lemon zest.
Slowly add your dry and wet ingredients to the ingredients already in your stand mixer - to do this you're going to alternate adding the dry and wet in about 3 batches. Begin by adding one batch of your dry mixture, mix slowly in your stand mixer until completely combined, and scrape down the sides of the bowl with a rubber spatula as necessary. Then add 1/3 of your wet ingredients, mixing until completely combined, and scraping down sides as necessary. Continue on this way making sure to end with dry ingredients and combining completely each time.
Pour into your prepared square baking dish, smooth out with a rubber spatula, and bake in the center of the oven for about 18-20 minutes or until the top is lightly golden and a toothpick inserted into the center no longer comes out wet (moist crumbs on the toothpick is ok). Another test for a cooked cake is lightly pressing the center, if it sinks or feels wet, it's not done. If it springs back up when lightly touched and feels spongey and firm then it's done.
Let your cake cool completely then carefully remove from your baking dish and cut into cubes.
Store in a ziplock bag or airtight container at room temperature until ready to use. If storing for more than a day or two I suggest freezing for optimal freshness. Then defrosting at room temperature before making the trifle.