This is called a battery.
Hooper & Whyld's The Oxford Companion to Chess says "battery" is "a problem term for one of the two kinds of ambush: a line-piece would command a line if another man of the same colour were moved off that line. Discovered checks arise from this kind of ambush. ... Players occasionally use the word 'battery' to describe doubled or tripled line-pieces; [problem] composers rarely use the word in this sense."
That book says that ambush is a term for a situation where a line-piece would command a line if another man [of no matter which colour] were moved off that line.
Sometimes these terms are used: rear piece for the piece whose attack line gets opened/discovered, and front piece/unit for the one that moves to open this line.
Problemists don't need the word battery to cover situations where the two pieces defend each other: they have other terms such as Turton doubling and Zepler doubling, depending on how the pieces move once they are on the same line.