ANSWER: William Gates
SOURCE: George W. Cullum, Biographical Register of the Officers and Graduates of the United States Military Academy
Edit - Joseph Totten, like William Gates, was born in 1788, but I can find no support for the contention that Totten ever served in command of Fort Constitution.
hoosier