Does it have to be a potential combat situation for a pilot flying on another's wing to be called a wingman. If two aircraft are being flown in formation to a destination simply for the purpose of transportation, would the term wingman be used? Is wingman used in civilian aviation?
A wingman is used in a combat situation, the function of the wingman is to protect the aircraft it is assigned to. example:
Aircraft A is tasked with a reconnaissance mission to take photographs in hostile airspace. Aircraft B is assigned to A as it's wingman. If during the mission an enemy plane is spotted, the wingman (B) will do whatever it's takes to protect the mission of A.
For formation flying, there is a leader of the formation but to my knowledge there are no special word describing the roles of each aircraft in the formation.
While the terms originated with the military, they are used in the civilian world when flying in formation. Formation flying does require training to be performed safely. As formation flying is not mainstream, getting the necessary training can be problematic.
One source is the organizations associated with Formation and Safety Team (FAST). They are "a worldwide, educational organization dedicated to teaching safe formation flying in restored, vintage military aircraft and civilian aircraft." Their training protocols are pretty much the standard for formation flying in the civilian world.
On their website they provide training and reference material. In all formation flying, there is a "Lead" and there is one or more "Wingman" or just "Wing". So, yes, the term wingman is used outside the military.