I am booked on a river cruise out of Moscow from 6th of may which I can get a letter of invitation, but the trouble is my plane arrives in Moscow on the 5th, at about 10pm. I had intended waiting in the airport until my invitation becomes valid at midnight. Does anyone know if I can do this?
You should not have any problems at immigration. Nobody will force you to go through immigration straight away and immigration won't care which flight you arrived with. They will not mind giving you a stamp at 1 minute past midnight.
The only question is whether the airline will allow you to board the plane.
It would seem logical to me that they will let you fly, at least if you explain your situation to them. But it's hard to predict how they will react. Maybe give them a call and clarify this. Or even better, send them an email, and when they say they will let you board the plane, print out their email in case the staff at the check in counter are unsure.