Leaving this for my future self:
Basically I need to get the IP address that was assigned to the Pi on the wlan0 interface, and then change the last octet of the assigned IP soon after.
Let me break it down:
Get IP from DHCP
I needed to get the IP, extract the subnet part and change the last octet to what I want:
ifconfig wlan0 | grep -P inet[^6][0-9]\+.[0-9]...