It is quite simple to achieve, you just need to have an eye on the routing of the computers.
Say your WiFi Network has the Network 192.168.178.0/24, means the WiFi network has an address range from 192.168.178.1 - 192.168.178.255.
When you connect a computer via WiFi, the router will configure that machine via DHCP to send all packets from the 192.168.178.0/24 network to the router, and sets itself as a default gateway, that you talk to the router when you want to access a IP from the internet.
That's all fine and we won't touch the WiFi network and it's configuration.
Now, you just make up a new network, configure all relevant Ethernet interfaces with it, lets say the 192.168.177.0/24 network.
Machine A's wired Ethernet configuration:
Static IP: 192.168.177.11
Netmask: 255.255.255.0
with no gateway!
Machine B's wired Ethernet configuration:
Static IP: 192.168.177.12
Netmask: 255.255.255.0
with no gateway!
NAS's wired Ethernet configuration
Static IP: 192.168.177.10
Netmask: 255.255.255.0
with no gateway!
Then your two computers can access the WiFi Network with internet access, and when you address the 192.168.177.0/24 Network, your computers will choose the cable to talk with each other or your NAS beside your coexisting WiFi network simultaneously - so both connects are active.
The easiest way to configure the NAS is to connect it once to an existing network like the WiFi router (with cable), then you can address it with one of your computers and configure the static IP - after you have done that, your NAS is not available in your WiFi network anymore, but when you have set up your Computers' Ethernet-Interfaces, you can continue talking to you NAS in your isolated, cable-bound network.
And if you are cool and use Linux, here is a sample Machine A's wired Ethernet network configuration in /etc/network/interfaces, assuming you're running a Debian based Linux (like Ubuntu and also Raspberry PI), assuming it's Ethernet interface is called eth0.
auto eth0
iface eth0 inet static
address 192.168.177.11/24
Cheers