It had been a campaign to forget for Plzen, who were pointless heading into Tuesday night's Group D game, but they knew that victory would be enough to see them pip CSKA to third place on their head-to-head record.
The Czechs were determined to score in the first half but failed to make the breakthrough - an honour which fell to Moscow's Ahmed Musa shortly after the break.
The game then swung on Alan Dzagoev's dismissal for violent conduct and Daniel Kolar promptly equalised to put Plzen back on course towards taking a first point.
All three would stay at the Doosan Arena, though, with Wagner rifling in a late strike before Pontus Wernbloom compounded CSKA's misery by getting himself sent off.
Plzen would just edge an end-to-end half, their desire to close out a disappointing campaign in style apparent from the off.
Igor Akinfeev realised how keen the Czechs were to score when Tomas Horava forced him into a save in the eighth minute but CSKA were straight up the other end, Rasmus Elm blasting over the bar.
Kolar tried his luck from distance but shot wide before the play switched and Musa drilled past Matus Kozacik's goalmouth.
Stanislav Tecl made Akinfeev work from 12 yards and, from the resulting corner, David Limbersky volleyed just over to keep the Muscovites on their toes.
Kozacik was needed on the half-hour mark and kept Plzen alive with a double save on Zoran Tosic and Musa.
The last word of an exciting first half went to the hosts, who went close to taking the lead through Michal Duris' just moments before the break.
Leonid Slutsky's team talk worked wonders on the Russian team and they quickly turned the screw on a retreating Plzen side when play resumed.
Dzagoev, Musa and Georgi Milanov all tested Kozacik's resolve in 10 frantic minutes with the former returning on the hour mark to really challenge the former Sparta Prague keeper.
He parried well but five minutes later he was picking the ball out of the net when Musa struck.
The Nigerian had been a constant menace and made the most of Keisuke Honda's right-wing cross, tucking home from six yards with a minimum of fuss.
Two minutes later, however, CSKA suffered an unexpected setback as a mad moment from Dzagoev left them preserving their slender lead with only 10 men.
The Russia international had seen red while fighting with Plzen players and received the same colour of card for his troubles.
The extra space allowed the Czechs room to respond and they did so through Marek Balos, who made Akinfeev punch his firm header to safety.
Plzen equalised in the 77th minute, Kolar more successful with his header after Pavel Horvath provided the pinpoint cross.
Their tails were up and substitute Wagner thought he had scored the winner four minutes from the end.
His glancing header sailed wide on that occasion but he would win the day on the stroke of full-time.
Frantisek Rajtoral supplied the cross and Wagner volleyed home with aplomb to inspire rapturous scenes at the Doosan Arena.
The disappointment was too much to take for Wernbloom, who lost his temper to pick up a needless red card for violent conduct while the Czech team danced around him in celebration.