Elected to the Senate in 1999 and reelected in 2003 and 2007, he was appointed to committees on Senate Services, Police Affairs (Chairman), Niger Delta and Banking, Insurance & Other Financial Institutions. In July 2008 the Election Petitions Tribunal sitting in Akure nullified Ogunniya's election. Ogunniya appealed the decision. He won. In a mid-term evaluation of Senators in May 2009, ThisDay noted that he sponsored a bill to reform the Police Regulatory Board, but rarely contributed to debate on the floor.
In December 2009 Ogunniya and three other House of Representatives members were arrested by the police for allegedly being in possession of three ballot boxes stuffed with thumb printed ballot papers during the re-run election into the Federal House of Representatives for Akoko South West/South East. The police also arrested about twenty thugs who had allegedly been hired by the Chairman of the senate committee from Kogi state, and twenty mobile policemen. The Ondo State Commissioner for Information said the role played by Ogunniya was "unbecoming of men purportedly elected into high offices". A spokesman for the lawmakers said they were not formally arrested, and the ballot boxes had been planted on them.
Ogunniya ran for reelection on the PDP platform in the 9 April 2011 elections, but was defeated by Akinyelure Patrick Ayo of the Labour Party, who gained 113,292 votes to Ogunniya's 41,783 votes.