Far better to connect the inverter as close as you can get to the battery(ies). The inverter takes a lot of dc current and there will be a considerable voltage loss in cables over 4 to 5 feet long. Your manual should give you recommendations for the size of cable, cable length, and method of attaching the conectors. AC current will be less than 10% of the dc current, so the ac cables will be easier, and cheaper to install.
Go
here (one of many sites) for more information about inverters and installation
Bob