Captain of engineering is the title given to chief engineers who hold the rank of captain.
In 2285, Montgomery Scott was reported to the new transwarp vessel, the USS Excelsior as the captain of engineering. (TOS movie, novelization & comic adaptation: The Search for Spock)
Captain Scott retained his rank when he moved on to the USS Enterprise-A. (TOS movie, novelization & comic adaptation: The Final Frontier)
In 2383, Geordi La Forge was made the captain of engineering aboard the USS Enterprise-E after his command of the USS Challenger (for which he had been promoted to captain) ended and he returned to the Enterprise. (TNG novel: Indistinguishable from Magic)
La Forge later decided to be relieved of the title of Captain of engineering, preferring to return to being a Commander. (ST - Typhon Pact novel: Plagues of Night)