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.’
Nemanja Matic believes Manchester United boss Jose Mourinho's driven methods and high expectations will bring the club more success.
Cardiff remain unhappy with Derby's decision to postpone Sunday's Sky Bet Championship game at Pride Park.
Dundee United boss Csaba Laszlo has been left hoping for St Mirren to slip up in the race to seal promotion to the Ladbrokes Premiership.