Joe Root and Dawid Malan began the fightback to take England to 171-3 in its second innings, only two runs ahead of West Indies at stumps on Day 3 of the second test on Sunday.
Root was 45 not out and his unbroken partnership with Malan was worth 77 by the close at Headingley, edging England ahead after West Indies finished on 427 all out in its first innings.
Root was on course to reach 50 for the sixth time in 11 innings this summer, and Malan was 21 not out. In a further boost to England, opener Mark Stoneman made 52, a maiden half-century in his second test.
West Indies had applied the pressure on England earlier in the day with a 169-run first-innings lead. That total was set up by centuries on Day 2 from Shai Hope (147) and Kraigg Brathwaite (134) and a 75-run partnership on Sunday between West Indies captain Jason Holder (43) and Jermaine Blackwood (49).
Holder had a standout day when he followed up on that effort with the bat by taking 2-44 at the start of England's second innings.
Holder forced out Alastair Cook and Tom Westley, both caught behind by wicketkeeper Shane Dowrich, and England was 94-3 before Root and Malan came together.
Earlier, West Indies were bowled out for 427, a lead of 169 runs, in reply to England's 258, after lunch had been delayed by 30 minutes with the tourists' nine wickets down.
It was a remarkable turnaround given that the West Indies had lost 19 wickets inside a day while being dismissed for just 168 and 137 during last week's innings and 209-run defeat at Edgbaston in the first of a three-Test series.
Anderson, now three away from becoming the first England bowler to take 500 Test wickets, led the attack with five for 76 in 29 overs.
West Indies resumed on 329 for five, a lead of 71.
Shai Hope was 147 not out.
Together with opener Kraigg Brathwaite, who made 134, he shared a stand of 246 for the fourth wicket on Saturday.
Their partnership was the West Indies' highest for any wicket in a Test in England since Gordon Greenidge (214 not out) and larry Gomes (92 not out) added an unbeaten 287 for the second wicket at lord's in 1984.
But thoughts of Hope going on to 150 ended when, without adding to his overnight score, he was caught behind off the opening ball of the morning from Anderson.
Hope, a 23-year-old Barbadian, batted for more than five hours and faced 253 balls including 23 fours in what was his maiden Test hundred.
Next ball Shane Dowrich nicked Anderson to England captain Joe Root at second slip and West Indies were 329 for seven.
But Holder survived Anderson's hat-trick ball with a solid forward defensive shot.
The next over saw Blackwood, still on his overnight 21, mistime a drive off Stuart Broad only for Moeen Ali to drop a routine catch at mid-on.
The diminutive Blackwood and the towering Holder bolstered their side's position with several excellent shots. Holder pulled Broad resoundingly for four to extend the lead beyond 100. Holder eventually fell when he miscued a lofted drive off Chris Woakes and Ali, running back at mid-off, took a well- judged catch.