The Pilgrims served up a disjointed performance in front of their own supporters, with Ainge sending home a diving header on 31 minutes.
Swain added Town's second 13 minutes after half-time following some calamitous United defending while Leesley wrapped up the scoring from the penalty spot with nine minutes to play.
The tone for United’s afternoon had been set less than a minute into the contest, with keeper Ross Durrant scuffing a routine clearance and Warren Burrell smacking the crossbar with an opportunist effort from the halfway line.
Lewis Turner subsequently thumped the crossbar too, although the referee’s whistle sounded for an infringement.
Harrogate took the lead when Leesley whipped in a deep cross from the Town left and AINGE got behind Charlie Gatter to bullet a header beyond Durrant.
Joe Colbeck went close twice at the beginning of the second half as Town threatened to put the contest to bed and they did manage to add their second goal in the 58th minute.
Kalern Thomas, Josh Robinson and Tom Batchelor all had chances to clear but SWAIN sneaked in to wriggle past Durrant and fire home into an unguarded net.
The Pilgrims rattled the woodwork through Ben Gordon’s curling free-kick on the hour mark but Town completed the scoring on 81 minutes when LEESLEY picked himself up after being fouled by Thomas and duly sent Durrant the wrong way from the spot.
Boston (3-5-2): Ross Durrant; Josh Robinson, Tom Batchelor, Charlie Gatter (Lewis Hilliard 54); Kalern Thomas, Shane Clarke, Adam Chapman (Karl Hawley 69), Callum Chippendale (Alex Simmons 63), Ben Gordon; Richard Brodie, Jay Rollins. Subs (not used): Joe Fitzpatrick, Jan Yeomans.
Harrogate (4-4-2): Peter Crook; Lewis Turner, Danny Ellis, Luke Shiels, Ben Parker; Joe Colbeck, Lloyd Kerry (Andi Thanoj 74), Warren Burrell (Tom Platt 83), Joe Leesley; Simon Ainge (Kuda Muskwe 76), Louie Swain. Subs (not used): Jack Emmett, Liam Agnew.
Referee: Anthony Tankard.
Attendance: 1,112 (57 visitors).