The 32-year-old struck for just the second time in 93 appearances for his country as Ireland came from behind to win at the Aviva Stadium on Tuesday night and give themselves an excellent chance of being seeded among the second group for the Euro 2016 draw.
Miroslav Beranek's men had threatened to ruin the home side's evening by taking a 13th-minute lead in spectacular style when Dmitriy Shomko lashed home an unstoppable shot from 25 yards.
Seamus Coleman made a mess of clearing his lines, Shomko ran on to the loose ball and smashed a left-foot shot across the helpless David Forde and inside the far post.
But as so often in the past, the Republic were able to rely upon returning skipper Robbie Keane to get them out of trouble.
The 33-year-old, who missed Friday night's 3-0 Group C defeat in Germany with an ankle injury, converted a 16th-minute penalty for his 61st goal in the famous green shirt.
Defender Alexander Kislitsyn, claiming in vain for a push in the back, met Andy Reid's free-kick with his hand inside the penalty area and Latvia referee Vadims Direktorenko wasted little time in pointing to the spot.
Keane, whose goal in Kazakhstan had also come from 12 yards, expertly sent Sidelnikov the wrong way to restore parity, and a measure of calm was restored.
However, it was O'Shea, whose last and only previous senior international strike came against Australia in 2003, who fired the Republic ahead from point-blank range as he pounced on keeper Andrey Sidelnikov's 26th-minute error.
Sidelnikov, who had endured a less than convincing opening to the game, pushed Richard Dunne's header straight to O'Shea, and he made no mistake from close range.
Keane was at less than his clinical best when he sliced harmlessly wide within seconds of the restart after being allowed to connect with a long ball out of defence, but Ireland returned intent on building sustained pressure.
Glenn Whelan and Anthony Stokes both went close as the Kazakhs found themselves pinned back deep inside their own half, and Sidelnikov was mightily relieved to see Andy Reid's speculative 64th-minute effort clear his cross bar as he scrambled back towards his line.
But he was beaten again with 13 minutes remaining when Shomko could only help substitute Aiden McGeady's cross into his own net under extreme pressure from Doyle and Keane.
It all meant interim boss Noel King emerged from his two-game spell in charge with the win he craved, and with the approach he took largely vindicated.
It was he who decided to call up Reid and Stokes, who had been discarded by Giovanni Trapattoni, to the squad, with Reid in particular making the most of his first game for his country since November 2007.
However, another of the men he invited back in from the cold, midfielder Darron Gibson, departed prematurely in far less auspicious circumstances after he collapsed in agony following a 35th-minute challenge and, in front of watching Everton manager Roberto Martinez, was carried from the field on a stretcher with suspected knee ligament damage.
An FAI statement issued via its Twitter account said: "Darron Gibson has been assessed by our team doc and will return to his club tomorrow for a scan with suspected knee ligament damage."