You can do it with GNU tar -T but it often requires shell redirection or spawning a process to be concise.
tar zcvf tarball.tar.gz -T <(file_name_generator_function_or_process)
Or echo /etc/hosts | tar zcvf tarball.tar.gz -T-
I'm long in the tooth enough to remember when tar on SunOS was used for system and data backups to SCSI tape drives.