The visitors created the better chances, but Peterhead were poor and at no stage looked like upsetting Allan Maitland's side.
A poor first half saw Alloa go close after six minutes with Graeme Brown testing keeper Paul Mathers with a curling shot just inside the penalty area.
John Grant was unlucky to see a dipping shot from 30 yards go beyond Mathers but over the crossbar after 15 minutes.
A minute later Kieran McAnespie thought he had scored when his shot crept under the body of Mathers, but the keeper recovered to scramble the ball off the line.
Bobby Linn created the home side's only first-half threat with a 20-yard shot.
Alloa continued to dominate after the break and David McClune was denied by Mathers after cutting in from the right wing in the 55th minute.
Slightly against the run of play, Peterhead took the lead on the hour mark. Dougie Cameron sent over a free-kick from the right and defender Craig Tully headed in at the back post.
Alloa drew level after 75 minutes with McAnespie heading a Bobby Sloan cross on to Brown who headed in from close range.
Two minutes from the end, substitute Javier Henares Payo pounced on a poor kick out by Mathers before rounding the keeper and shooting into the empty net.