If you are looking to avoid eating late at night, I would advise timing your pre-workout meal to be about an hour or so before you get to the gym. And that meal would be more of an energy meal, quality carbs mostly and only about 200 calories. Then have a solid protein and carb post workout meal ready for immediately after your workout. The most recent information recommends 20-30 grams of protein with 40 – 60 grams of quality carbs for the post workout meal. So you would be looking at another 200 calories or more post exercise. You can try to see how small of a pre-workout meal will get you through the workout without having your energy bottom out. And how small of a post meal will keep your gains from dropping. You have to pay attention and you should be recording as much information as you can. That way you can look at your data and see what is and isn’t working for you.
I would also recommend going to a registered dietician if you are really serious about this. An RD can save you a lot of trial and error time. RDs are not prohibitively priced in most areas. And you can’t get better nutritional advice from anyone else.