D.D.
I agree with Margie that the five hour direct flight will be a long time on the airplane. Book the flights with the layover.
Be prepared with books and toys. Also, if you can choose your seats, try to get the bulkhead. When I fly with my boy (almost three), sitting in the bulkhead allows him to get out of his seat and stand, hop around, and stretch his legs.
My last note is to remain calm. If your son gets a bit crazy or is whining, calm and comfort him as you would at home, and do not let the attitudes, looks, and heavy sighs from other passengers get to you.
Good luck and have fun.