John Kiarie, known as KJ, has won the tightly contested Dagoretti South parliamentary seat.
Mr Kiarie, who was vying on a UDA ticket, garnered a total of 26,394 votes to beat his long-time political rival Dennis Waweru who managed a total of 22,773 votes.
In third place was Brian Muchene, an independent candidate with 13, 786 votes.
"I want to thank the people of Dagoretti for coming out in large numbers to vote for me and my party leader and presidential candidate Dr William Samoei Ruto," he said after being declared the winner.
Mr Kiarie criticised the Supreme Court's ruling that found the CDF Act unconstitutional.
"The 13th Parliament's first responsibility should be to find ways in which to restore the conditional grant that is CDF," he said.
He said the fund was critical to many Kenyans, especially when it comes to financing education programmes.
Earlier in the day, Mr Waweru, who was vying on a Jubilee ticket, stormed the polling station with his supporters. He alleged there were election malpractices.
In the presidential tally, Dr Ruto garnered 40,120, Mr Raila Odinga 26,947, George Wajakoya of Roots party 328, while Waihiga Mwaure of Agano party had 230 votes. The constituency has a total of 114,930 registered voters, 68,407 of whom cast their ballots on Tuesday.