Anier took his tally for the season to seven with emphatic finishes in each half and Ainsworth coolly finished off a well-worked move in between as Motherwell secured their 10th Scottish Premiership win and their first Fir Park victory over St Mirren for three years.
Manager Stuart McCall had expressed optimism on the eve of the game that he could extend both players' loan deals beyond the first weeks of January and they responded by playing integral roles in what was arguably Motherwell's most fluent performance of the season.
Ainsworth has had a stop-start spell at Fir Park because of minor injuries but he was a constant threat on the right wing from the opening seconds when his cross was headed just wide by Anier.
The hosts, who were unchanged from their win at Ross County, managed to push St Mirren back but it took until midway through the half before they created more chances.
The recalled Harkins shot not far over but Motherwell took the lead following an incisive move in the 31st minute. Ainsworth cut inside from the right and found Lasley with a reverse pass before the captain helped it on to Anier in the channel.
The Viking Stavanger striker turned Jim Goodwin one way and another before firing a powerful strike inside Kello's near post and into the roof of the net.
Ainsworth soon flashed a shot across the face of goal before Dan Twardzik retrieved an anxious situation as he punched clear after his initial attempt had spun into the air.
Kenny McLean's free-kick from the right soon carried over the on-loan Dundee goalkeeper in the wind but just cleared the bar and Motherwell doubled their lead in the 42nd minute.
Lasley won the ball on the right wing and played it to Anier. The Estonian and John Sutton both exchanged passes with Ainsworth to send the Rotherham winger through and he calmly slotted the ball into the bottom corner.
Sutton almost put the game beyond his former club in the 53rd minute when Darren McGregor's clearance left Kello stranded following Ainsworth's cross but Lee Mair cleared off the line after the striker attempted to roll the ball in from 20 yards.
Kello saved from Anier and Ainsworth before Twardzik beat away a powerful strike from John McGinn moments after the Saints midfielder had replaced Conor Newton.
But Anier put the result beyond doubt in the 63rd minute with a wonderful finish.
The Estonia international reacted quickly to meet Iain Vigurs' cross and sent a first-time left-footed volley into the bottom corner from 16 yards.
The goalscorers both went off to standing ovations and Saints never looking like launching a comeback apart from when Steven Thompson turned Kelly's cross just past the near post.
Motherwell took the sting out of their play but Sutton and substitute Paul Lawson both threatened in the closing stages.