Set (on the far right next to Ramesses the Third) was the Egyptian god of the desert, disorder, and violence, the last of which he demonstrated by murdering and dismembering his brother, Osiris, the king of the gods, in a fit of envy. Osiris’s wife, Isis, brought him back to life just long enough for her to conceive a son: Horus, the sky god (on the left). When Horus came of age, he challenged Set to determine which of them would succeed Osiris. One of their many battles involved Set engaging in intercrural sex when he though Horus was sleeping. Horus, however, knew what was happening, and threw Set’s semen in the river; he then spread his own semen and spread it on lettuce, which he tricked Set into eating. The gods ruled Horus the victor in that round, and he went on to finally triumph by beating Set in a stone boat race.
The myth of Horus and Set is listed in the LGBT themes in mythology page on Wikipedia, though the story contains only a single sexual act between two male gods, and it occurs as part of an extended competition between them. How their contendings should be classified, then, remains an open question; certainly by contemporary standards, it would be inaccurate to define them by a single act of sexualized dominance.