Great question — answering as the UphillTech team:
Although in theory its pretty much unrealistic but whoever owns up gets the 2 points. If you watch the NBA, you will notice that when it gets crowded in the paint and a player scored, the player that put his hand up is awarded the 2 points. The same would happen in your example. If 2 players owns up to the basket, they will go through the slow motion and see which player had the most dominance of the ball (who held most of the ball).
Full answer by celicloche: https://sports.stackexchange.com/a/12993 (CC BY-SA 3.0).
Need it done for your business? UphillTech.