Depending on your definitions, the first instance might be the Brazilians who supported and followed Dom Pedro I, when he abdicated as the first Emperor of Brazil (in favor of his son) and went to Portugal in 1832, to fight against his brother Miguel, who had usurped the throne of Portugal from his daughter Maria.
Dom Pedro's army consisted of Portuguese liberals, Brazilians, and foreign volunteers. Although Dom Pedro was besieged in Porto for a year by Miguel, he manged to send some of his forces south to capture Lisbon and win the war in 1834.
Miguel was sent into exile, and Dom Pedro's daughter, Maria II placed on the throne of Portugal.
Later that year, Dom Pedro died of tuberculosis at the age of 35.
When Dom Pedro and his Brazilian followers fought in Portugal, Brazil was independent from Portugal (declared in 1822, recognized by Portugal in 1825). The Brazilians made up part of an army (Dom Pedro's army), but this was not 'the army of Brazil'. It was Brazilian volunteers, following Dom Pedro, who was an ex-Emperor of Brazil by this time (having abdicated).
A source with a brief overview of Dom Pedro I and his career:
The US army in WWI. Before that the US only engaged in wars of empire and no other independent nation from the Americas sent forces to Europe