It looks like a prolapse of some sort. It could be penile, cloacal, or intestinal. Do you know for sure he is a male? Females can also have cloacal prolapse as well as intestinal. If the tissue is not going back in when left alone, you need a qualified vet that treats reptiles.
The tip of the prolapsed tissue is grey, which is not a good sign as it indicates dead tissue. It could be from the bites inflicted by his tank mate. Everted tissue is often seen as a food item, possibly due to its resemblance to carrion or earthworms.
It is not advised to try to re-insert the tissue yourself, and avoid touching the area at all except for during the below emergency preparations prior to taking to the vet.
Run a faucet on low with cool water to gently rinse the area.
To keep the area moist, you can use KY Jelly. If you speak to a vet prior to coming in, they may suggest a past of sugar and water to reduce swelling, but this can irritate tissue.
You need to keep the turtle in a clean hospital enclosure, such as a Kritter Keeper if large enough or a plastic tub that he can't escape from, with no sharp edges. You can use this to transport to the vet. Use wet newsprint to cushion the bottom of the tub. You may need to immobilize the turtle to avoid further damage to the tissue.
Protect the area with a plastic wrap "diaper" over the prolapse only for the amount of time it takes to get to the vet, as this can cause bacterial growth.
Tips on home care of a prolapse prior to seeing a vet are available here:
Again, it is important to seek vet treatment for a prolapse that lasts more than a few hours.