The keju (科举), the imperial civil service examination, ran from the Sui dynasty until its abolition in 1905. It is often cited as the gaokao's direct ancestor, and the analogy is not entirely wrong.
Both exams are (or were) standardized, meritocratic in principle, and function as the main gate through which young people from ordinary families can enter the elite. Both breed intensive preparation cultures.
But the differences are large. The keju tested classical scholarship — memorization of the Confucian canon and the ability to write formal essays on canonical themes. The gaokao tests a broad academic curriculum including math, science, and a foreign language.
The keju was a job interview: passing at the top level (进士) qualified you for imperial office. The gaokao is a university admissions exam. There is no direct government appointment at the end of it.
The keju admitted a few thousand candidates a year, empire-wide. The gaokao admits millions. Their social function is comparable at a very high level of abstraction and diverges everywhere else.