Might even be higher - in "Court Martial"
SPOCK: B deck, in or near Engineering.
KIRK: Seal off B deck, sections 18Y through 23D.
I figured that would make this engine room in the saucer where it services the impulse engines. However, does that mean the saucer engine room is below the bridge? (Note that since the engine room is effectively 2 decks tall then that might still work as it could occupy B and C deck...)
However for the "engineering decks" I think that refers to decks in the engineering hull.
Universal on all ships is a fairly common
compartment identification system. <I have no idea if this analysis has been done before on this site; if so, please except my apology. This is long, to get the conclusion, just jump to the bold line at the end.> So, I researched the naval compartment identification systems for ships, and I got some insight. Wiki says:
Compartments are identified by the deck forming the floor of that compartment. Different types of ships have different deck naming conventions. The United States Navy (USN) system identifies each compartment by a four-part code separated by hyphens. The first part of the code represents a numbered deck, the second part of the code is a hull support frame numbered sequentially from the bow, the third part of the code is a number representing compartment position with respect to the ship's centerline, and the fourth part of the code is alphabetic representing the use of that compartment. The centerline position code is zero for a compartment on the ship's centerline, odd numbers for compartments entirely to starboard of the centerline, and even for compartments entirely to port. For compartments sharing the same deck and forward frame, the first two parts of the code are identical, and the third part of the code is numbered outward from the centerline. The fourth part of the code is:
A for store rooms (or AA for cargo holds)
C for manned communication or control centers
E for manned engineering machinery spaces
F for oil storage tanks (or FF for oil cargo tanks)
G for gasoline-storage tanks (or GG for gasoline cargo tanks)
J for JP-5 storage tanks (or JJ for JP-5 cargo tanks)
K for chemical-storage spaces
L for living spaces, including sleeping, dining, washrooms, sick bay, and passageways.
M for ammunition magazines
Q for miscellaneous spaces not otherwise coded, including laundry, galley, pantries, wiring trunks, unmanned engineering, electrical and electronic spaces, shops, and offices.
T for vertical-access trunks (escape trunks)
V for void (empty) spaces
W for water-storage tanks
Starfleet must use a unique ship compartment identification system to deal with a circular primary hull and a cylinder secondary hull.
All systems use Deck No. followed by a Frame Identification. Frame Identifications can have numerical and alphabetical units. A natural point in the ship is the break between the saucer and the secondary hull, so, The saucer would have one type of system, and the secondary hull being a simple cylinder shape, would have another system. The neck would be with the secondary hull.
Putting the saucer system aside for now, the secondary hull system must be very simple having only deck and frame identifiers. 18Y = Deck 18, Frame Y. 23D = Deck 23, Frame D. "18Y through 23D" is the block of compartments for Decks 18 down to 23, and Frames D through Y. Deck number is self explanatory. Frame I.D. is in alphabetical order where Frame A is at the fore point and extends sequentially aft. After Z comes AA, etc. if needed.
"B deck" doesn't make naval sense unless it is a new letter designation like in the list above, but you would not use the term, "deck" with it. "H deck" has been previously used on this site to represent the Hangar Deck, so, maybe all that is in the secondary hull is "H" for Hangar operational areas, and "B" for the rest of the hull areas. Frame Y at the break point for the Hangar areas makes sense on how Kirk knew to stop at Frame Y. "B" deck must not include the dorsal neck (maybe "T" since the shape and function resembles a large, vertical-access trunk?), since Kirk also knew to exclude Frames A-C. Another simple choice, "B deck" or "B level" would be the second level up off the main deck in the engine room, but in naval terms, it would be expressed in "levels" and not "decks", but hey, its a spaceship and not a 20th century water ship. The simplest choice is "B deck"
is the secondary hull, where "A deck" is the saucer.
Kirk seals off compartments 18Y through 23D, where deck 18 must include the upper portion of the engine room, and "through deck 23" is down to the bottom of the ship. Remember, the original writer's guide gave 23 decks in the ship. The excluded areas are the aft Hangar areas, and everything Deck 17 and above.
Conclusion: The Engineering Room with the pipe cathedral is in the secondary hull, Decks 18 or lower between Frames D and Y. Easy Peasy. 