The Green Army's Charles Momanyi scored the opening goal of the match in the first half before Amos Kigadi equalised in the second half for Vihiga United.
It took Gor Mahia 13 minutes to find the back of the net via defender Momanyi, who was drafted in to replace injured Joash Onyango in the starting line up.
Momanyi rose high enough to meet a free-kick delivered by Samwel Onyango and headed past Patrick Matasio in the United goal.
Vihiga United won a free-kick a few yards from Gor Mahia's penalty box, but Alex Imbusia decided to go for power and saw his effort slide inches wide from the right-hand post in the 17th minute.
A dominant Gor Mahia saw their two front men - Nicholas Kipkirui and Jacques Tuyisenge - engage in a one-two, which split the Vihiga United defence but Tuyisenge could not control the final ball, which Matasio cleared.
Tuyisenge's 31st-minute header hit the post with Matasio beaten, but the assistant referee immediately raised his flag to indicate the Rwandan forward was in an offside position.
The Vihiga United custodian had to be alert once more in the 41st minute when he managed to parry away a powerful header by Onyango, who was set through on goal by Francis Kahata.
Kigadi headed successfully to restore parity in Machakos in the 58th minute. The Vihiga United forward surprisingly rose higher than the towering duo of Harun Shakava and Momanyi to peg the score back at 1-1.
Gor Mahia Starting XI: Fredrick Odhiambo (GK), Philemon Otieno, Geoffrey Ochieng, Charles Momanyi, Haron Shakava (Cpt), Ernest Wendo, Francis Kahata, Kenneth Muguna, Samuel Onyango, Nicholas Kipkirui, Jacques Tuyisenge.
Subs: Boniface Oluoch (GK), Joachim Oluoch, Bernard Ondiek, Bernard Omondi, Francis Mustafa, Erisa Ssekisambu.
Vihiga United Starting XI: Mike Matasio, Hedmond Mauda, Christopher Masinza, Zablon Khaemba, Ogutu, Victor Ademba, Stephen Wakanya, Muhanji, Kelvin Amos Kigadi, Alex Imbusia, Dennis Wafula.
Subs: Caleb Wamalwa, John Muyesu, Daudi Saisi, Godfrey Airo, Patrick Okulo, Michael Isabwa, Andrew Murunga.