In 1832 he was hired to teach chemistry, mineralogy, and botany at Bartlett's High School in Utica, New York, and at Fairfield Medical School, replacing instructors who had died in mid-term. Agreeing to teach for one year, with a break from August to December 1832, Gray had to cancel his plans for an expedition to Mexico, which at the time included what is now the southwestern United States. Gray first met Torrey in person in September 1832, and they went on an expedition to New Jersey. After completing his teaching assignment in Utica on August 1, 1833, Gray became an assistant to Torrey at the College of Physicians and Surgeons in New York City. By this time, Gray was corresponding and trading specimens with botanists not just in America, but also in Asia, Europe, and the Pacific Islands. Gray held a temporary teaching position in 1834 at Hamilton College. Due to funding shortages, in 1835 Gray was obliged to leave his job as Torrey's assistant, and in February or March 1836 became curator and librarian at the Lyceum of Natural History in New York, now called the New York Academy of Sciences. He had an apartment in their new building in Manhattan. Torrey's attempt to get Gray a job at Princeton University was unsuccessful, as were other attempts to find him a position in science. Despite Gray no longer being his assistant, Torrey and Gray became lifelong friends and colleagues. Torrey's wife, Eliza Torrey, had a profound impact upon Gray in his manners, tastes, habits, and religious life.