One way is to have an array of your marker names:
_markers=["one","two","three"] or whatever....
and then determine if the map click position is within a certain distance (20 meters??) of a marker or find which marker is closest.
Using SnyPir's distancepos function:
_mappos=map click position
_dis=999999
_closest=""
{_d=[_mappos,getmarkerpos _x] call distancepos;if (_d<_dis) then {_dis=_d;_closest=_x}} foreach _markers
_closest will contain the name of the closest marker to the map click position. _dis will be its distance. If _dis is less than , say 20 meters, then that is the marker you clicked on. That prevents clicking 1km away from the nearest marker and having it select that marker.
Syntax may not be perfect but that should work. Could be a better way also.