Christian Benteke had given the hosts the lead going into the half-time break but Jordan Henderson pulled one back before the Reds captain's spot-kick secured victory
Christian Benteke had given the Villans a first-half lead but Jordan Henderson equalised immediately after half-time before Gerrard then stepped up, after Luis Suarez had been felled in the box, to convert what would prove the winning spot-kick.
Paul Lambert made only one change to the side that beat QPR last time out as Joe Bennett returned to the defence, while Brendan Rodgers welcomed back Pepe Reina and Jamie Carragher, although Daniel Sturridge had to settle for a place among the substitutes.
Gabriel Agbonlahor squandered a glorious opportunity to give the hosts the lead in the 16th minute as he side-footed an effort from just seven yards out straight at Reina after Matthew Lowton had delivered a delicious low cross from the right.
Four minutes later, Suarez came close to adding to his 22 league goals this season as he picked up on a clever reverse pass from Glen Johnson and smashed high towards goal, forcing Brad Guzan to parry over the top of the bar.
But it was Villa that would take the lead after 32 minutes courtesy of Benteke. Agbonlahor provided the assist for his strike partner as he took down a long pass from Ashley Westwood with his thigh before the Belgian smashed a first-time half volley at goal that Reina could only help into the corner of his net.
Villa were nearly the architects of their own downfall shortly after, though, as Barry Bannan's wayward pass towards his own goal only served to put Suarez through on goal. The Uruguay international was denied by Guzan as he looked to slot his effort through the goalkeeper's legs.
Liverpool again came close to forcing an equaliser before half-time as, in the 43rd minute, Stewart Downing and Philippe Coutinho worked a short corner between them before laying off for Gerrard to send a dipping right-foot shot towards goal that Guzan again did well to push away with his left hand.
The visitors didn't have to wait long after the break to get back into the game, however, as, two minutes after the restart Henderson raced onto a delightful through pass from Coutinho before steadying himself and lifting a composed effort over the advancing Guzan and into the net.
Liverpool then came close to taking the lead as Coutinho first struck wide following a clever run across Villa right-back Lowton before Johnson struck the post with a bending shot that deflected off Bannan before rattling the woodwork.
With the next attack, though, the Reds were in front. Suarez, so deadly in and around the 18-yard box, jinked inside Nathan Baker, tempting the young defender into a challenge that left referee Lee Mason with little choice but to point to the spot where Gerrard made no mistake in slotting in low to Guzan's right.
Gerrard was then instrumental at the other end as he reacted superbly to head Benteke's powerful header off the line before Lowton had Reina scrambling with a cross-shot that forced the Spaniard to tip over the bar.
Benteke did hit the net for a second time in stoppage time but the goal was rightly chalked off for offside as Villa failed to ease their relegation fears, while Liverpool moved to within three points of Merseyside rivals Everton.