Do I need to upgrade iOS before creating backup to be restored onto new iPhone? Do I need to upgrade iOS before creating backup to be restored onto a new iPhone?

I have an iPhone 7 running iOS 10 and would like to upgrade to iPhone X.

iPhone X ships with iOS 11 and I'm looking for the proper way to transfer data when the new phone arrives.

Do I need to upgrade the older iPhone first to iOS 11 before creating a backup to be restored onto iPhone X?
No - you should probably always backup before any upgrade just in case the upgrade fails. I would get a backup as soon as you can in general as well as in specific when you are about to move or upgrade.

The good thing about your situation is the iPhone X and iOS 11 setup assistant will remind you to make a backup of the old device and even let you start the setup and wait for the other backup to complete.

Getting a backup now is good since backups to iCloud and backups to iTunes tend to be incremental so they save several backups and the next backup will just need to save changed data and often completes very quickly.

The only time you might consider upgrading is if you have a really old version of iOS and skipped several major versions. I do like always updating right before a transfer since sometimes minor updates fix issues with setup so you can skip those bugs by updating everything after you have a good foundation backup.