Everton recovered from their Merseyside derby thrashing by Liverpool to beat Aston Villa thanks to Kevin Mirallas's superb 25-yard free-kick.
It looked like the hosts would suffer consecutive defeats after Villa defended Leandro Bacuna's first-half goal, their only shot on target.
But substitute Steven Naismith broke Villa's resistance with a 16-yard shot.
And Mirallas's curling strike five minutes from time moved Everton up to fifth in the Premier League table.
Everton and Martinez record landmark win
Beating Aston Villa earned Everton their 300th Premier League win
It was also a 100th victory for Roberto Martinez in English football and his 50th in the Premier League
Prior to this result, Villa had only lost three times away all season and their 3-5-2 formation, along with some brave defending, made it look like they would pinch victory.
But Roberto Martinez's decision to push up Leon Osman in support of lone striker Mirallas and introduce Naismith in the second half proved the difference.
With Tottenham drawing at Hull, Everton leapfrogged the north London side, whom they face a week on Sunday, and moved a point behind their Merseyside rivals as they continue their chase for a place in next season's Champions League.
And the manner in which Martinez continued to push for victory, despite
lacking top scorer Romelu Lukaku,
suggests they will press their challengers for the rest of the season.
Villa were happy to yield possession for long periods and, once they scored against the run of play, looked intent on simply defending their lead.
However, once Naismith had scored after 74 minutes, Villa boss Paul Lambert did try to go for a winner.
His side missed a chance to pull further away from the relegation zone but they stay 10th in the Premier League and are five points above the drop zone.
The visitors were close to going behind early on when Aiden McGeady, making his first Premier League start
since signing from Spartak Moscow,
cut in from the right and hit the far post with a curling shot.
Mirallas a star player - Martinez
But for the rest of the first half, Everton failed to test Brad Guzan in the Villa goal, and Lambert's side easily absorbed the pressure before scoring from their first decent break.
Fabian Delph, who was impressive throughout, timed his tackle on Ross Barkley to perfection with Christian Benteke picking up the loose ball and feeding Bacuna, who nutmegged Tim Howard.
who lost 4-0 at Liverpool on Tuesday,
improved after the break as Osman was shifted infield to support Mirallas. England international Osman had two good opportunities but did not trouble Guzan, while substitute Steven Pienaar shot straight at the American goalkeeper.
Villa excellent despite defeat - Lambert
By the hour mark, Villa barely ventured out of their own half although Benteke almost headed into his own net. It was arguably as close as Everton had come to scoring.
Martinez then opted to replace defender John Stones with Naismith, and the game changed as the Scot picked up Pienaar's clever pass and found the bottom corner from 16 yards.
It looked like the game would remain level, until Mirallas ensured Everton fans ended the week in a better mood.
Everton boss Roberto Martinez:
"I think it's without the doubt the most satisfying win of the season. You come in on the back of a disappointing result and you want to get it right straight away. But in the first half we were too responsible, the players were thinking too much, and we were too concerned with the outcome rather than enjoying it.
"We hit the post and we concede a goal, so it becomes a real moment of adversity, but the way we reacted was an incredible example. After that test we are ready to finish the season as strong as we can."
Aston Villa boss Paul Lambert:
"We were excellent up until that first Everton goal, then for the second it's a world class free kick. You cannot do anything about that but I'm not so sure we deserved to lose the game.
"I'm not happy to lose but we had a really gruelling match on Wednesday night [against West Brom] and we had only two days to recover from it but if we keep that level of performance we will be all right."
For the best photos from Saturday's Premier League games, visit the BBC Sport
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.