Pars marksman Rhys McCabe hopes his winner can help Dunfermline over the finishing line to clinch the Ladbrokes League One title within the next two weeks.
His 81st minute free-kick took a wicked deflection off the Cowdenbeath defensive wall and gave home keeper Grant Adam no chance.
McCabe came off the bench only minutes earlier.
If Dunfermline beat Brechin City on Saturday and Peterhead cannot get all three points against Cowdenbeath, that would give the Pars the title due to goal difference.
Referee Stephen Finnie sent both managers from the trackside and also Cowdenbeath assistant boss Jason Dair.
Dair’s dismissal was for protesting over a booking for a Cowden player after only six minutes.
Pars boss Allan Johnston was sent packing for querying why his team had not been awarded a penalty for a challenge on Brad McKay, before Colin Nish was given a ‘red’ for protesting about the foul which led to the winner.
Johnston said: “Our passing was not at all good in the first 45 minutes and Cowden played well and had us in a bit of trouble.
“However, the second-half saw a big improvement and the longer the game went the more the winning goal looked like it was going to come, and this was the sort of result you need when you are looking to win a title.”
Cowden are at the bottom of the table as both rivals Forfar Athletic and Brechin City won.
Nish said: “I felt we played really well against the team that is top of the table and could have sneaked the lead at times in the game.
“We were right in the picture when they get that free-kick on the edge of our box and the ball takes the most wicked of deflections and goes in. We were defending well throughout the game but it was always one of those fixtures where the first goal was going to be crucial.”
He was very pleased with the performance of new centre-back Craig Sives from Livingston and hopes that the quality of the defensive work will continue in the remaining six fixtures.
Nish added: “We know what we have to do. We need points and in every game we play we must look to collect all three.”