July is peak season and as you're 5 and arriving on the departure day, I'd make them in advance if possible. The only current way that works is by contacting Andy : https://www.seat61.com/trains-and-routes/bucharest-and-sofia-to-istanbul-by-train.htm#how-to-buy-tickets
There's a substantial booking fee of about 15€ (write that you've been directed to him by Seat61's website to reduce a bit the fee).
Ask him if it would be enough to book a whole compartment for yourselves. Yes there are only 4 couchettes AFAIK but otherwise you would be separated…
There is only one through couchette carriage from Bucharest attached to regional trains along the way. There are more carriages on the Sofia - Istanbul night train that you could join in Dimitrovgrad in case. But better if you can directly have your space from Bucharest !
I'm curious if it will work this way. AFAIK Andy uses the DB system to issue these reservations and @seewulf wrote last week that DB could not book this train this year (they could last year).
I was wondering which system he uses too... then that might be complicated indeed.
Otherwise book regular tickets on CFR website : about 150€ for 4 people.
Unfortunately CFR doesn't want to sell them via email... you can always try though.