The best way I can think of solving this is by utilizing a procedure. For your example, it would look somewhat like this:
@startuml
!procedure $passthrough($a, $b, $gw)
$a -> $gw
$gw -> $b
!endprocedure
component A
component B
component C
component "Gateway" as GW
$passthrough(A, C, GW)
$passthrough(B, C, GW)
@enduml
PS Sorry, just realized this had the 'Wanted Feature' tag - In any case, hope this answer can serve as an aid before the feature is implemented :)