The episode was called 'The Price of Tomatoes (S4E25), and Denver played a tomato famer called Titus Purcell. It originally aired on March 1st, 1968 (incidentally, Cathy's 14th birthday). I'd have to disagree about Denver's look - as Briscoe Darling, Denver had a mustache, whereas Titus Purcell had a full beard with a little color in it, so he looked like a younger Uncle Jesse. You can see the whole episode below:
As far as I know, neither 'The Andy Griffith Show' or 'Gomer Pyle: USMC' were shown in the UK. I'm familiar with the former through HNet, and the latter only after I investigated Jim Nabors' appearance in 'Cannonball Run II' as Pvt. Homer Lyle (another Cathy connection, although I don't remember Jim and Cathy having any scenes together).
It may surprise (or as Gomer would say, "Surprise, surprise, surprise!") many Americans that some of their biggest shows didn't air much if at all outside the US, so the references in movies are often lost on us over here. I found an article called 7 huge US pop-culture touchstones UK viewers just don't get which lists some of them. 'Gilligan's Island' is #1 and 'Gomer Pyle' is #7. Obviously things have changed with the internet giving us access to clips and whole shows, but we still have to look them up.