A very early Google Books match for "gear up" as a verb phrase appears in "Hot Springs and the Dutchman," in Sabbath School Visiter (April 1837):
A Dutchman, who was removing with his family to the western part of Virginia, came to the Hot Springs. Pleased with the appearance of the soil, and the majestic grandeur of the forest, he told his sons that he should like to stop there; and directing them to ungear the horses, he went down to the spring to try the water. Alarmed at its temperature, he hurried back to the wagon, exclaiming, "Gear up boys, gear up ; for be sure hell ish not more as half a mile from dish place." We laugh at the ignorant terrors of the honest Dutchman : but there are objects of his dread. Avoid them, my young friends; "pass not by them ; turn from them and pass away , lest your feet go down to death, and your steps take hold on hell."
Here the "gearing up" refers to reversing the ungearing of the horses—that is, harnessing them and hitching them to the wagon (if they were a team) or saddling them (if they were riding horses), setting their bridles in place, and the like.
Even earlier is a journal entry for June 24, 1835, in "Extracts from the Journal of Mr. Parker," reprinted in The Missionary Herald (September 1837):
June 24, 1835. At break of day the call is made, "Out, out, gear up your mules." We get on our ways about sunrise, travel on until about mid-day, when we stop for breakfast. Our horses and mules are then turned out for about two hours , to feed upon the prairies under guard.
And earlier still is a review of "Mary Holley, &c., Texas: Observations, Historical, Geographical, and Descriptive" (published in 1833), in The Western Monthly Magazine (December 1834):
Sometimes one place is cried up, sometimes another—and then a rush to it. One year it is Alabama, another, Jackson's purchase, and then it is the Sangamon country ; and no sooner does rumor thus invest a famed region for imaginary charms, than hundreds of farmers mount their horses and ride off to explore it, and hundreds of others, who are too impatient to look before they leap, gear up their teams, and move away to the land of promise.
In all three instances, "gearing up" evidently refers to preparing one's horses, mules, or oxen for travel. Later matches from the early 1840s and early 1850s use "gear up" in the same sense. And that appears to be the earliest sense of "gear up" as a verb phrase in English.
A Google Books search for "gear up" over they years 1800–1950 shows that use of the term first reached significant levels in the 1830s:
"Gear up" as a verb phrase used in the sense of "prepare machinery for operation" emerges in the final quarter of the nineteenth century, with a first Google Books match from a patent specification filed on September 27, 1875 for "Equalizers of Spring-Power":
The aggregate power of all [the springs] is thus stored up on one shaft, and I gear up for the required speed from that shaft; or a single slide or plate may be employed to compress all the springs used, and one or more cords extending from such plate to the shaft.
Update (August 16, 2020): An even earlier instance of 'gear up', from a newspaper
An Elephind newspaper database search yields this instance from an untitled item in a Philadelphia, Pennsylvania, newspaper, reprinted in the [Leesburg, Virginia] Genius of Liberty (January 30, 1824):
Some time since, a wagoner, in ascending the Alleghany mountain, found a good deal of difficulty to get along, in consequence of the road being very icy, and his horses not rough shod. When about half way up, he stopped the team, unhitched the horses, took them to a smith-shop and had the shoes of his horses roughed. He ascended to the wagon, and just at the moment of his catching hold of the tongue chain, to gear up, his wagon started backward, and after running down the mountain some distance, ran over the monstrous precipice on the side of the mountain; and strange to relate, not a single article, with the exception of the feed trough, was injured.
This instance is particularly interesting, not just because it is older than the ones previously noted, but because it describes "gearing up" as a specific operation involving attaching the tongue chain of the wagon to the harness hames of the team of horses. Here is the definition of tongue-chain in [The Century Dictionary: An Encyclopedic Lexicon of the English Language](The Century Dictionary) (1891):
tongue-chain n. One of the chains which support the fore end of a wagon-tongue and connect it with the hames of the harness.
And here is the relevant definition of hame in the third volume of the same dictionary (1889):
hame n. ... 2. One of two curved pieces of wood or metal in the harness of a draft-horse, to which the traces are fastened, and which lie upon the collar or have pads attached to them fitting the horse's neck.
It thus appears that—in Philadelphia in 1824, at least—"gearing up" involved the specific act of attaching the tongue chain of a wagon to the hames on the harnesses of the horses in the team that would be pulling the wagon.