Special forces stormed the Nave Andromeda on 25 October after the crew raised concerns about stowaways.
Matthew Okorie, 25 and Sunday Sylvester, 22, had been charged with conduct endangering ships.
The cases have been discontinued after new expert evidence emerged, the Crown Prosecution Service (CPS) said
Hampshire Constabulary said the five other men, who were arrested on suspicion of seizing or exercising control of a ship by use of threats or force, also face no police action.
They will remain detained under immigration regulations.
Sophie Stevens, senior district crown prosecutor, said: “The CPS has a duty to keep all cases under continuous review and after additional maritime expert evidence came to light, we concluded there was no longer a realistic prospect of conviction and discontinued the case.”