The Northern Irishman’s 19th and 22nd-minute strikes cancelled out Murray Davidson’s 10th-minute opener for the home side as the visitors secured the three points and a third consecutive Scottish Premiership victory.
Magennis failed to convert several opportunities to make it a hat-trick but those missed chances were not punished by Tommy Wright’s men, who have now lost five consecutive league matches.
St Johnstone had the better of the opening exchanges and took the lead within 10 minutes. James McFadden’s centre found Davidson who stroked the ball past Connor Brennan from eight yards.
Killie captain Manuel Pascali desperately attempted to clear from the goal-line, only for referee Craig Thomson to rule that the shot had already crossed the line, sparking furious protests from the visitors.
However, conceding the goal did spark the visitors into life and within 10 minutes of falling behind they had crept into the lead.
Ross Barbour’s whipped delivery found Magennis in the box and his pin-point header into the top-left corner levelled the scores.
And three minutes later Magennis was at it again. Rory McKenzie’s corner found the striker, buoyed by his earlier goal, in the box and his header found the bottom right-hand corner of the St Johnstone goal.
The result moves Kilmarnock, who travel to Celtic next week, up to fourth in the table while St Johnstone, who have now suffered five defeats from their last five games, remain in ninth ahead of their visit to Partick.