Not sure if this is the answer you are looking for, but what I usually do is go into polygon select mode, select one corner at a time (Can select one polygon and hit in the menu Select>Select Connected), then right click on the material you want in that corner and hit apply. It should only apply it to the selected polygons. After it’s applied you’ll see it show up next to the name of your object on the top right as a tiny icon. if you click once on the material there you have better controls over it below, and can select the uvw type you want, in this case I would go with box.
Hope that helps and wasn’t too complicated to follow!