Lewis Milne's pass set Greig Spence clear, and he slotted the game's only goal before the break.
Peterhead pushed for a leveller, but it was Cowdenbeath who came closest to the next goal when Spence hit a post.
The visitors are two points above Forfar Athletic and Brechin City in ninth and tenth spots, respectively.
Cowdenbeath moved off the foot of League One with a surprise win at second-placed Peterhead, meaning Dunfermline Athletic sealed the title.