DRC rule to check if a Footprint (B) has a track (A)'s NetName?

Is it possible to use DRC rules to check whether a footprint has a pad that can (must) connect to the current track being routed?

I’d like to match this to construct a (better) neckdown / fanout rule where a controlled-impedance track will be allowed a smaller clearance within the courtyard of a (BGA) footprint.

Edit: Example DRC rule, note that hasNetName() is the missing bit:

(rule DP_fanout
	(condition "(A.inDiffPair('*')
			     || A.NetClass == 'DP*'
				 || A.NetClass == 'CPHY'
				&& B.Type == 'Footprint'
				&& B.hasNetName(A.NetName) # How to do this?
				&& A.intersectsBackCourtyard(B)"
	(constraint clearance (min 0.09mm))
	(constraint track_width (min 0.09mm))
	(constraint track_width (opt 0.09mm))