The home side took an early lead through Jamal Lowe with a thumping finish but it was Gillingham who dominated the second half with Conor Wilkinson levelling soon after the restart.
Martin then took centre-stage with goals in the 66th and 80th minutes to secure victory, and leave his manager gushing with praise.
Lovell said: ‘I keep saying it about Lee Martin, but he is a tremendous professional.
‘He is a leader and he inspires the team on.
‘He is an older head in the side and there is no substitute for experience, so I am pleased he got his goals.
‘He has claimed our second but I don’t know whether Conor Wilkinson is sure about that as he reckons he definitely got a touch on it.
‘I know I would claim it so he has the right to claim it but that doesn’t matter.
‘We got the points, we won 3-1 against a great club and won our eighth game on the road this season.’
Pompey went ahead after 19 minutes when Lowe, having been played in by Kal Naismith, turned in the box and fired a shot into the roof of the net.
But the away side equalised in the 48th minute through former Pompey player and second-half substitute Wilkinson when he curled his effort into the bottom corner.
Portsmouth came close to regaining their lead shortly after as Connor Ronan had Gillingham goalkeeper Tomas Holy beaten, but his shot bounced back off the frame of the goal.
Gills skipper Martin then got the first of his double when he whipped in a free-kick which found its way through everybody and into the back of the net.
But there was no luck involved with his spectacular second as he found the top corner from outside the box with 10 minutes remaining.
Portsmouth manager Kenny Jackett believed his defence showed a lack of experience.
He said: ‘I felt it was a positive performance in the first half and we deserved the lead.
‘We had a lot of the play and had one or two key chances to go further ahead.
‘We didn’t sustain our period of pressure without conceding, which is something we have done for a little while.
‘We have lacked experience, leadership and talking on the pitch at the back and although Gillingham’s strikes were excellent, it’s a frustration.
‘We have to be good enough to sustain our lead and battle it out to make sure they don’t get the goals to get them back in the game.’
Rangers manager Steven Gerrard is weighing up a move for Liverpool full-back Jon Flanagan, reports claim.
Scottish champions Celtic are reportedly ready to offer full-back Calvin Miller a new deal before sending him out on loan.
Everton target Jack Wilshere has sparked a scramble for his signature after confirming he is leaving Arsenal this summer.
Tottenham's hopes of landing Wilfried Zaha have been hit by the news Crystal Palace have offered him a bumper new deal to stay.
Ryan Giggs says Gareth Bale would be the perfect fit for Manchester United but has doubts over whether he will leave Real Madrid.
Manchester City's attempts to sign Riyad Mahrez could be in doubt again as reports claim Leicester only want a straight cash deal.