Like with all cases where you need to keep someone sharp, it mostly depend on the person. There will not be an 'one fits all' solution.
My approach with coach and car drivers is always based on their reactions and I guess that pilots be be no different, some indicate they want you to chat constantly, others that you just talk every now and again and others are so non-responsive that you feel you are not welcome.
First thing you need to work out is whether you have language in common, and whether you can amuse or entertain the person to be kept sharp with your natural patter or favorite subjects.
It is much harder when your chat is annoying to the person, as he or she would rather have you go away.
Of course, knowledge of the work is useful. Just like you should not distract a driver on a busy crossing, there will be times in a cockpit where the pilot has to be there for the work.
For many people 'work' is hobby, so a natural subject to talk about with a pilot is planes. Those they can fly, those they might want to fly and maybe also those that are out of reach but very interesting.
If you have a good memory for facts, reading and remembering stats about the newest but also the oldest planes will likely be useful. But even if you just get the pilot to talk you may be on the right track. Ask about favorite plane, and settle in to be bored to death by details on performance.
Other likely subjects are cars, racing, sports (base it on the country and the international competitions going on, football (soccer, rugby, American, Aussie Rules...) Tour de France bike ride in July and on.
Do not rule out any subject, from fly fishing to birds, from latest holiday to houses that he might have seen, the list is endless.
And if you are passionate about anything, mention it.
I am always surprised how many want to know more about my hobby, and how much they do know even when they claim they do not know a thing.
But do not talk all flight/night long. Let silences occur, but watch for slacking in attention. A short sound, like a cough, might be all that is needed. Silence and someone who is near might even be all that is needed for some people, as long as you are the one that is awake and not likely to fall asleep when you are needed.
I do not know the rules in non-commercial flight. But in a coach my mother has kept the driver from falling asleep with the offer of a sweet, just a few words and a bit of sugar was all that was needed, she is sure.
Direction of travel
People often claim that one direction of travel affects humans more than the other. But my personal experience is that it depends much more on how rested you were when you started your travel.
Likely also your personal way of reacting, so some people may be more affected by one direction, other by the other, real or just because that is what they expect.
If you can talk with the pilot about his expectations and experiences, so you are aware of what the problem spots might be.
And you should be aware of your own weak spots. If you tend to fall asleep after two hours flight, you will need to keep yourself awake through that spot if you want to be of use to keep the pilot sharp.
Difficult periods are, generally, after meals. And when it is time to go to bed in the time zone you just left and in the time zone that is home to the crew.
Disclaimer. I have never spoken with pilots who fly long flights regularly.