Outfit meaning people working as a team was first attested in 1833 per OED. This sense was first used for the divisions of American Fur Company. OED provides the definition of this sense and the earliest citation as below:
4. colloquial (originally U.S.).
a. Any group of people engaged in the same occupation or belonging to the same organization (occasionally with the implication of being slightly disreputable or unconventional); spec. (a) a business firm or concern; (b) a group of musicians.
1833 K. McKenzie Let. in F. A. Chardon Jrnl. Fort Clark (1997) 355 He could not sell the Sioux outfit in which Leclèrc had a share until Spring.
I've found further evidence of what outfit means in fur trade context and how it was used by American Fur Company (from Last days of the upper Mississippi fur trade by Rhoda R. Gilman):
IN 1834 the Upper Mississippi Valley Indian trade,
despite changes at the top, still operated much as it
had for a number of decades. It was shared between
two major divisions of the American Fur Company,
which, although never maintaining a total monopoly,
was the region's dominant influence by a long frontier
mile. The company's structure reflected a consistent
policy of maximizing profit and minimizing risk for
the parent concern at the expense of its agents in the
field. Its organizational unit was the "outfit" — a term
that might apply to anything from a single trader's
annual canoeload of goods to a major regional division.
The sense "a set of clothes (often including accessories) selected or designed to be worn together" of outfit is from 1840 per OED and was attested later than the sense "people working as a team".
1840 R. H. Dana Two Years before Mast xxvii. 293 The usual outfit of pumps, white stockings, loose white duck trowsers [etc.].
Thus, the sense "people working as a team" may not be a semantic extension from there. Although, outfit in the second earliest citation in OED for this sense is used for a group of musicians and it is from 1870; so there may be separate routes of semantic development.
1870 N.Y. Clipper 16 Apr. 15/4 The banjo is also one of the great features of the ‘outfit’.
The "equipment" sense of outfit is from 1787, originally used for "the articles and equipment required for an expedition; and later, equipment of any kind" per OED. All these senses are ultimately from the obsolete sense "The action of fitting out or equipping a ship, etc., for a journey or expedition, or for any purpose, as fighting, etc. Also: the cost of doing this." from 1748 per OED.
Outfit is formed within English by derivation from out- prefix + fit noun. However, OED also compares it to the obsolete phrasal verb to fit out which has the most basic semantic definition where all senses of outfit are developed from:
to fit out: to supply with what is necessary; to equip, rig out. Obsolete exc. Nautical or transferred from that use.
1670 R. Coke Disc. Trade 63 A Dutch Ship..may be built and fitted out to Sea for half the terms an English Ship can.