What you are asking for is not possible. Even if both apps use the same Google project, the same project number and the same API key (which is possible), each app will register separately to GCM and receive a different registration ID. You would have to send the message to both registration IDs in order for both apps on the same device to receive it.
It doesn't make sense, though, to have two apps on the same device receiving the same message. If your requirement is to have two versions of the same app (for example a free version and a paid version), and each device would have only one of the two installed, your server doesn't need to know about the difference between the two apps if you use the same project number and API key (since the same API key would be used to send messages to both apps).