Goals from Will Keane and Stephen Humphrys had given Latics a richly-deserved 2-0 half-time advantage.
But after sending on Ben Reeves at the break, Lovell saw the Gills restore parity by the 70-minute mark.
First Reeves rifled past Ben Amos eight minutes after the break, before Stuart O'Keefe equalised just after the three-quarter mark.
Unfortunately for the Gills, Reeves then pulled up lame, which coincided with Latics forcing a late winner.
James McClean's 77th-minute corner was headed back in by an unmarked Jason Kerr, for Keane to stab the ball home on the goalline.
"We fought so hard to get back into the game," mused Lovell. "And once we got it back to 2-2, I thought there was only one team that was going to go on and win it.
"There was a real opportunity for us to pick up all three points, never mind hanging on for a draw.
"But they've obviously gone on and got a third goal - again a free header from a corner - which is so disappointing.
"I think if Ben had stayed on, we might even have nicked it at the end.
"Even for their winning goal, Reevesy would have been in their box marking their man.
"They had seven men in the box for a corner, we had six markers, and they've ended up with a spare man for the header.
"You can't come to places like Wigan and have to score four goals to win a game."
Get 20% off our sports subscription package and stay up to date with all the latest Wigan Athletic news with a year’s subscription to WiganToday for less than 9p a day. Use promo code TRANSFER20